Visual Studio REST Patch Not Updating

This is a Xamarin Forms app and I’m running the Epicor Rest API that @josecgomez and @jgiese.wci wrote.
I have an updateable BAQ in which I wrote custom base processing for the update method to do what I want.
If I run the patch through the Swagger UI, it works fine.
If I run it through my app, it runs without error, but it does not seem to execute the update.
The response data seems to be in line with what the Swagger response shows.
Any reason why this wouldn’t be executing the update routine in the BAQ like it does through Swagger?
I have a couple other updateable BAQs in this app that run just fine with the same login info.

You need to pass a RowMod=“U”

I’ll give it a shot.
How come the other two work without passing it?

Depends on the way you wrote the UBAQ? See if the RowMod does it if not we’ll have to investigate further.

No dice.

And if you make the update in swagger it works?

Yup.

ok there is a RequestLog in the EpicorREST class can you paste the last entry there? It’s going to be a bunch of crazy looking JSON

EpicorRest.RequestLog

Right after your Patch call get the latest entry in that List and send it.

Based on that Request Log, looks like there’s a BPM blocking the update.
It’s weird that the Swagger UI didn’t get stopped, though.

1 Like

You guys have any other goodies like that hidden in your API? Lol

bahaha… maybe… keep using it and find out… it gets improved when something we need fixed lol (or you I suppose if you ask nicely LoL)

1 Like

By the way since you have a dynamic object you can address the fields by name not sure if you knew… but you can do

foreach(dynamic d in data.value)
          Console.WriteLine(d.Calculated_RcptUOM);

It won’t auto complete cause well it doesn’t know ahead of time but it will work

1 Like

Is there an easy way to parse that Request Log?
I tried using the JObject.Parse on the last item in the collection, but it didn’t like it.

nah your best bet is to copy the JSON stuff and remove the back slashes is not pretty but it is useful

My goal was to spit the message in the Call Context back to the application to show the user why the transaction didn’t occur.

Hmm I think there’s probably a way to get that… let me think.

Did you come across anything that would work for this?

I just updated the nuget with a new property inthe EpicorRest class called “LastCallHeaders”

dynamic x = EpicorRest.GetBAQResultJSON("zCustomer01", null);
var headers = EpicorRest.LastCallHeaders; // It is a collection of the headers returned by the call

IT will take around 20 minutes for the nugets to update fully. It should be at version 1.1.5

The headers in the collection get updated after each call… so every Patch, Get, post call will result a “new” headers.

1 Like

Will these ever change? For instance, header #6 has the data I’m looking for with the call contexts and whatnot. Will header 6 always be those call contexts for that specific REST call?

Use LINQ to get it by name

var contextHeader = headers.Where(z=>z.Name=="ContextHeader").FirstOrDefault();