Many Thanks. Weird thing was a straight copy produced errors. If I typed it out, no errors.
How would one pass in just one portion of the dataset for an UpdateExt on JobEntry? Do I need the entire payload as executed in swagger or Postman? I would assume minimum is to remove quotes from ds, JobHead, Company etcā¦ Still need continueProcessingOnError
{
"ds": {
"JobHead": [
{
"Company": "****",
"JobEngineered": false,
"JobReleased": false,
"JobNum": "239825",
"UD_SysRevID": "&&&&"
}
]
},
"continueProcessingOnError": false,
"rollbackParentOnChildError": false
}
Probably the Open Quote/Closed Quote thing.
āā vs ""
@josecgomez ā¦ Hey ā¦ Iām getting this JSON error when the session is getting disposed.
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.JsonTextReader.Read()
at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at EpicorRestAPI.EpicorRest.DynamicPost(String bo, String method, Object postData, Boolean replaceReturn, EpicorRestStatusCode responseStatusCode, CallContextHeader callContextHeader)
at EpicorRestAPI.EpicorSession.Dispose(Boolean native)
at EpicorRestAPI.EpicorSession.Dispose()
ā¦ itās happening in EpicorRest, showing [decompiled]:
Newtonsoft version is 11.02 but havenāt made any code changes to the project.
Any ideas?
UPDATE: It doesnāt seem to occur reliably. Can anyone surmise why/what circumstance this might happen?
Itās lonely in hereā¦
Iām having issues getting the EpicorRestAPI to work for me. Im guessing I have something setup incorrectly and that is the issue. If Someone could help with this I would appreciate it.
Dictionary<string, string> dic = new Dictionary<string, string>();
CallContextHeader callContext = new CallContextHeader();
dic.Add("$top", "10");
EpicorRest.AppPoolHost = "erp.wi.com";
EpicorRest.AppPoolInstance = "KineticTest";
EpicorRest.UserName = "UserName";
EpicorRest.Password = "Password";
EpicorRest.Company = "Company";
EpicorRest.APIKey = "Key";
EpicorRest.APIVersion = EpicorRestVersion.V2;
var data = EpicorRest.BoGet("Erp.Bo.PartRevSearchSvc", "A14C", dic, callContext);
Hi Tim, welcome. Have you instantiated/initialized the EpicorRest object?
Iām still using V1 but hereās a basic setup:
EpicorRest.AppPoolHost = AppPoolHost;
EpicorRest.AppPoolInstance = AppPoolInstance;
EpicorRest.UserName = UserName;
EpicorRest.Password = Password;
EpicorRest.BearerToken = BearerToken;
EpicorRest.IgnoreCertErrors = false;if (UseWebServicesLicence) EpicorRest.License = EpicorLicenseType.WebService;
else EpicorRest.License = EpicorLicenseType.Default;EpicorRest.CallSettings = new CallSettings(CompanyID, String.Empty, String.Empty, String.Empty);
Jeff thanks for the quick response. Mine looks like itās set up pretty much like yours.
Lot me check those search BOs are funky does it work in swagger??
Though it looks like a REsT Sharp error do you have to r dependencies installed?
Thanks for Responding Jose. I was able to do it in swagger and in postman. I have loaded the libraries for restsharp 109.0.1 and I am using the 2.1.0.3 version of EpicorRestAPIā¦
Yes looks like it canāt find the constructor for RestClient.
I would try removing the dependencies and add them back in case something went haywire.
Kevin I uninstalled and reinstalled restsharp and still get the error is there a different version of restsharp I should be using? when I look at NuGet it shows no dependencyās so Iām not sure which version of RestSharp Iām supposed to be usingā¦
I havenāt done a lot of rest calls against Epicor so I actually have not had the opportunity to use @josecgomez tool, so I was just speaking in general.
What version of .Net?
.net 4.8
ok yeah you arenāt setting up that call correctly.
PartRevSearch has two ODataEnd Points
/PartRevSearches [GET] [POST]
and
.PartRevSearches(āCompanyā,āPartā,āRevā,āAltā,āProcessMfgā) [Get][Delete][Patch]
You arenāt calling either of these.
You are doing a BO Get on Erp.BO.PartRevSearchSvc/A14C ā which isnāt a valid end point. Iām Assuming you are trying to get the revisions for a Part number Called A14C? In that case the call should be
[GET] Erp.BO.PartRevSearchSvc/PartRevSearches?$filter=PartNum eq āA14Cā
Which in my LIbrary would be something like
Dictionary<string, string> dic = new Dictionary<string, string>();
dic.Add("$filter","PartNum eq 'A14c'");
var data = EpicorRest.BoGet("Erp.BO.PartRevSearchSvc", "PartRevSearches", dic, callContext);
(sorry to inject my own question during your flow here Tim)
Anyoneā¦ I have a BAQ that accepts a parameter @DataTags that is used in the BAQ Designer in a Table Criteria where the table field is IN clause the @DataTags list.
Because the field is a string, in SQL this would yield something like "ā¦WHERE field IN (āstringAā, āstringBā, āstringCā) ā¦ " but I donāt know how to pass that parameter so that it will work via the client.
Anyone have any helpful tips here?
Add the same parameter over and over again. (its kind of hard to do with a dictionary though
Let me see I think I have a way stand by doing some testing.
ā¦ I could still leave the BAQ Table Criteria as in IN? The IN clause is an OR state, correct? I donāt want a field = āstring1ā AND field = āstring2ā AND field = āstring3ā ā¦ is the concern with what youāre suggesting, no?
You donāt ahve to change the BAQ passing the same paramter over and over again fills in that ParamList. Stand by doing some testing.