Best practices for debugging Kinetic/Application Studio?

Hi all,

I’m trying to debug a complex function.

I initially was using PublishInfoMessage to create popup messages. For a while, that seemed reliable. (I used debug flags that I set at the beginning of the function so I could easily turn them on and off without having to comment/uncomment them.)

This seemed to be a reasonable approach, but then sometimes, in some environments, the messages just don’t show.

I have asked Perplexity AI, and it seems to say that PublishInfoMessage won’t always show.

When I asked for best practices, it seemed to say that temporarily throwing an exception is the recommended way (not my idea of a good plan).

Further suggestions were to create a UD log table in the database and insert records into that.

So, what do YOU use to debug App Studio processes/functions/etc.?

Thank you in advance!

Greg

1 Like

Are you on-prem ? if yes you could use this :

string msg =" Test Log Message";
Ice.Diagnostics.Log.WriteEntry(msg);

it will write in the server windows event journal.
You can see Create and Log to a File (in customization) - #2 by surendrapal for more ideas.

You could write all of your debugging info to an output parameter and then use the Function Executioner that Jose made to manually run your function and view all of the outputs. I’ve found it incredibly useful when working on new functions.

7 Likes

Yes we are on-prem. I will try this.

That function executioner sounds really nice. Sadly, we are on Kinetic version 2023.2, but we’ll be up to 2025.x next year (if we get approval, etc.).

Looking forward to trying the Function executioner. I grumble every time I have to click Demote from Production, Design, Source, edit one line of code, then Save, Save, Promote to Production.

1 Like

You inspired me to fix the “Demoted”/“Publish” concept, fix here (i too, grumble alot):
https://www.epiusers.help/t/bypass-epicor-functions-maintenance-published-demoted-concept-and-ownedbycompany-separation-concept/131396?u=gabefranco

2 Likes