I have inherited the following,
I have chunk of custom code that executes on a button press on a form.
I would like my custom code to call a function using the REST api.
I already have two examples of this in the custom code, calling other functions in the same library.
So I followed the examples and tweaked for my new function, the code looks like this:
I am debugging the custom code in Visual Studio and I know the above is getting executed.
There are no exceptions being thrown, no error messages.
I have a message popup first thing in the function code, which never shows up.
So it appears Itās not being called
Looking for ideas on how to debug/fix this.
This is Epicor Kinetic 2022 and we are off-premises Epicor hosted,
In this situation is it possible to debug Function code ??
Iām sure there are other ways, but the simplest Iāve found is to use
Ice.Diagnostics.Log.WriteEntry(āYour DebugDataā);
to write information into the server event log.
MessageBox.Show() is for client side customization
Infomessage.Publish() will send a message through a BPM. Although, if you get more than a layer down (a bpm calling another bpm etc) many times they wonāt show.
My function does throw up a message (I didnāt mean literally Message.Show()).
I know this cause my function is also used by a BPM that is tied to a form and when itās invoked I get the message. (wouldnāt that be a similar case, or no ?)
This is the code Iām using in my function to show the message:
butā¦putting debug data in there isnāt going to help me because this is the first line in my function and it doesnāt appear.
You can also install the MS Remote Debugger on the server and debug your functions that way. I have done it with BPMs and now am with Functions. It is a nice way to debug your code.
Yes, I have a screen customization calling a function (code function not widget function) via rest api.
I also have a method directive calling the same function.
the first thing the function does is pop open a message (which works when calling from the bpm)
but calling the function from the screen custom code does not
this (and the swagger response) makes me believe itās not even getting to my function in the screen customization case
On Swagger your message Info will show up as a header under CallContext. If you are getting 500 on Swagger thereās ssomething else wrong with your function.