Kinetic 2023.1 PublishInfoMessage not working anymore

Are you trying to call a messagebox from a function?

Depending on how it is called, it can show up, but many times it won’t be triggered.
The UI has to have a way to catch it.

3 Likes

Yes, from a function. I know it worked before the upgrade. :thinking: I’m placing @josecgomez snippet in different parts of my function to see it works.

Okay the PublishInfoMessage works in a method directive. (Payment Entry → Update)

I’d replace the entire function with just a message box.

Are you sure? Are you testing it the same exact way?

Yes, no code modifications. Just called my function as usual to see where I left it at (Messages will give me information) but nothing showed up.

Which is how?

Click a custom button to select data from payment entry table and show it in a message.
I replaced the retireved text for a fixed value “TEST”.
Also replaced the whole code for the snippet Jose provided.
Nothing worked.

Classic or Kinetic?

How do you know the function fired?

Kinetic.
I know the function is fired because I can thwo an exception from it.



throw new Ice.Common.BusinessObjectException(
                new Ice.Common.BusinessObjectMessage("TEST")
                    {
                        Type = Ice.Common.BusinessObjectMessageType.Error,
                    });

image

Let’s isolate it a bit further.

Make a new layer on a completely different screen and call it.

Also, if you open up the dev-tools in the browser, you should be able to find where the function was called in the network tab. Look in the response headers under CallContext.

You should see if data is being returned. If it is in there, something else is wrong.

Look at this picture from this post:

I’m not sure that Info message was ever supposed to work in a function… Functions are mostly to be invoked via REST I’m not sure how that would translate to a Kinetic Layer… It seems you said it worked before :thinking: but from a design perspective it doens’t make sense to me.

Epicor functions are independent of the UX

We have abrand new instance aht uses kinetic 2022.2 I will try with that version and let you know.

Rule #1 of Functions, and Directives, is put a try…catch block around your code. My guess is some of your other code is throwing and failing silently.

Were you able to find a fix? I have always used “PublishInfoMessage” in my functions to debug it! I am not after the 2023.1 upgrade!!

It’s a good guess, and good advice, but here we made his function only call PublishInfoMessage.

I agree that @shuotonashi and @d.priya.naidu that PublishInfoMessage used to work prior to latest upgrade, but no longer does…

I wish it did work with functions, if I’m several levels deep in a string of functions calls. it’s very convenient to have a button, call top level function on click, and show an error message any where in that call stack without having to percolate that message back to the top of the stack

I suppose if every function was properly wrapped in try catch blocks, and exceptions are rethrown up to each layer it’s possible to then set a response param in the top level function that can be used with the “dialog-show” widget…

OR…just have the top level throw the “Ice.Common.BusinessObjectException” exception passing it the info and appropriate info level

This is ALOT of custom code from classic UI that I have converted to functions in preparation for Kinetic UI

Looking for advices and thoughts

Thanks, Scott

I’ve submitted an Epicor Idea related to the DevOps one (but with more votes, it can be split out separately now) on improving observability. This would give us a better way to trace transactions without using display statements and potentially get far better logging and metrics.

Enable Open Telemetry for better observability | Epicor Kinetic Ideas (aha.io)