How to Handle System generated Yes/No messages in function/BPM - I see them in the Trace

Hello All,

I traced a method for a receipt transaction and for a specific vendor there is always a pop up that says, “are you sure you would like to do this?” They always click yes and then it proceeds to finish the transaction, but I don’t know how to do this in the code. I see that after clicking yes it runs the “update master,” method again, but with different parameters so I tried that in my code, but then I get a null reference error.

In short, how do you handle messages in a function or a BPM that would normally pop up in the UI?

Thanks,

Utah

My assumption is that it is a BPM Form on a method. Have you checked the Method Directives or Data Directives to find it?

What do you mean by check the method directives or data directives to find “it?”

Is “it” the popup message?

All I know right now is that the question is stored in an out parameter on the UpdateMaster method called “qMessageStr.”

Yes, check the Method Directive Maintenance for UpdateMaster and see if there is a “Call BPM Data Form” in it.

image

John,

I am talking about a native Yes/No form that pops up in receipt entry when doing a receipt… how do I handle that?

This yes/no popup is not a BPM data form on a method directive, it is coming from the system itself.

Sorry, totally missed that!! :crazy_face:

Are you trying to stop it or automate it?

automate…

I think I may have figured out a way though.

The trace shows that it calls update master when I do it from the normal receipt entry UI and then the message pops up and I click yes, then it calls update master again, but this time with different parameters.

Now in my function I am going to check the dataset after the first update master call and if there is a question message about the UOM calculation, I will send the dataset through a second update master call with the different parameters as I mentioned above.

I just tested if I could do that successfully and it worked.

1 Like

You might also want to just do a Method Directive that changes the parameter that calls the pop up box to false.

John, I don’t see a parameter like that. I really think it is looking at the qmessage parameter and then throwing the message box if its value is different from “”.

You could try setting that parameter to “” and then you might not have to call the second update master? Just a thought, but sounds like your way is working.

I tried that the other day cause I have done that for things like the “are you sure you want to…” messages, but I got an error message that threw me off track… so I think I gave up and chalked it up to “not working.” Let me try that again now that I have fixed the error message that was unrelated.

I typically decompile the client side of things to understand these prompts. The screen code will show what variables are checked causing the prompt. JetBrains dotPeek is free for this, and many others might recommend something like .NET Reflector (paid).

1 Like

Interesting Zach. I have never tried to decompile the UI.

I do feel like it isn’t all in the UI though. Would you agree that the UI still calls some business methods and then updates accordingly?

Therefore you could handle this potentially on the server side or on the UI side- in some cases.

In other situations it is all handled in the client dll and there is no way to intercept it in bpms or server side methods.

You’ll find the BOs used in each of the screens’ Transaction class. As a consultant, this was one of the most valuable tools when making automations.

For example, in Erp.UI.VendorEntry.dll, you’ll find the VendorTransaction class. This is the oTrans object and all of the BO usages will be from here.

It’s pretty consistent amongst most of the UIs, but you’ll find annoying differences. Like in one, I found the oTrans update method was protected. Little bit of reflection and problem solved.

Yeah I need to somehow learn what you are talking about.

I have never completely understood the oTrans object or the BO usages from there.

As we move to kinetic though, is there any use in trying to understand it?

1 Like

I might be totally off beam here, but is it anything like the “quantitycontinue” field you have to set if you try to automate job closing? In the UI, if you try to clise a job and the quantity of material is less than required you get a prompt. In DMT or a BPM, you have to set the field “quantitycontinue” to the integer 1.

Why an integer I’ll never know, but it means “yes” to that prompt. I’d check the DMT version of receipt entry for some kind of confirmation or continuation field.