Required field in UD1XX pre-processing BPM

,

image

image

It lists severity as ‘Information’, but the save never completes and the transaction seems to be rolled back since the UD11 step does not complete as well. Full source here: full bpm code.

Did you check for any other BPM’s that may be affecting your process? It looks you have a BPM messing you up.

I would agree. I have looked, but don’t see anything that looks like it would be affected by what I am doing.

I read your post on asking a question, so to help, my background is as a developer (.NET since it was created, so many years). During my previous employment I wrote many applications all external to Epicor (v8 and 9) to interface to and from Epicor data mainly using .NET bindings to Epicor business objects, prior to the whole Rest discovery, so I am familiar with reflection and the business objects themselves. I actually wrote a complete Service Connect replacement in C#. But not much by way of troubleshooting Epicor BPMs and/or UI customizations. You can see my source as referenced above. The only thing I am changing that I would think would trigger a BPM are tables UD11, UD105 and UD105a. Wouldn’t that be the only places where BPMs would fire? I am open to any (even what you may consider to be basic) questions that I may not have considered, or suggestions of tools to use for debugging, since currently I am just displaying messageboxes with needed info.

Thanks greatly for the help.

ok, So this will be basic stuff, sorry if you already know/tried it. Maybe something here will trigger something new.

So if it was me looking, it looks like a BPM message. I would pull up all of my BPM’s and take a look through them. If you select <any> on the search by directive group, it will pull up all of your bpms. Even the ones that you didn’t set a group. Then once you get them in the window you should be able to pretty quickly look through them to find a message box that pops up that information. Maybe you have one on an unrelated method/table that’s doing some linq lookup across the database and throwing this message.

1 Like

Also you can try BPM tracing. You should be able to see what BPM’s are firing.

image

1 Like

Another thing to think about is, if you are using a code block, any messages that you display will not always fire in the order, or at the time you might expect them too. A better way to do that is probably to add tracing. You can record your values and you can see exactly when it quits. The pop-up messages can be deceiving.

Last thing I will recommend is to take another look at the UD field properties. Pasts a screen shot here so we can take a look too. What type do you have for the UD field? Is it a nullable type? Are you sure that your PO is getting assigned in your code? Try the tracing thing to verify that. or even in your message box add ttIR.POLine.ToString() to see if there is actually a PO number being passed.

1 Like

This is good. Encouraging, since I had already done the first 2 suggestions. I also went as far as to copy my live database into a test environment, and turn off EVERY method and data directive except mine. Yep, still got the error. The writing my own trace log looks interesting. I will give that a try.

One more thing, I seem to remember looking through Epicor SQL tables years ago and found that BPM code was stored in a table. So, since it looks like a message coming from a BPM, couldn’t I do a SQL query and look for “POLine is required”?

Well, after reviewing your code from the other thread , it’s clearly coming from your message box you have in there. I would bet it’s the settings on the UD field for the ponum. Can you post a screen shot for the properties of that field?

That would be correct, and the exception is passed back from the UD105 Update line, causing the message box to display. I assume you meant a screen shot of the POLine UD Field, but I will post both in case. I am working on the “personal” trace log this morning. Many thanks again.


I wanted the second. The integer type is non-nullable, which is why even though it’s not “required” it could be barking at you. Try setting that field to 0 somewhere before you try to really set it and see if it lets you finish.

Also, try putting the value in your message. ttIR.POLine.ToString() to see if there actually is a PO number in there.

Set the value of ttIR.POLine to 0, but error’d saying PORel record wasn’t available. Makes sense since there is no line 0 on the PO. Tried to ‘hard’ set it to 1, still got the POLine is required error. Took the hadr set back out and reran. Pasted below is the error message with the ttIR.POLine value:
image

can you try in your message box the value of tsUD105.UD105[0]["POLine_c"] instead of the ttValue, to make sure it’s set correctly?

And what happens if you hardcode this line

tsUD105.UD105[0]["POLine_c"] = ttIR.POLine;

to something like.

tsUD105.UD105[0]["POLine_c"] = 999;

In essence, I already did that. I can’t display the actual values of tsUD105.UD105[0]["POLine_c"] or ttIR.POLine in the messagebox since at that point they are out of context. I created a global value of int POLine = 0 and changed the receiving line to POLine = tsUD105.UD105[0]["POLine_c"] = ttIR.POLine; and displayed POLine. I will try hard coding the tsUD105.UD105[0]["POLine_c"] = <correct line number> since if I use 999, I assume I will get the PORel record not available.

The UD table shouldn’t care what value is there. That exception is coming from the UD table. It doesn’t have anything to do with the PO stuff. (an interesting test would be for you to change the label on that field and see if the exception message follows your changes. I bet it does)

For the message box, just pop another message box in context.

I am assuming that it is doing some sort of PO validation in the process, that is why when I set the value to zero earlier, it came back with PORel record is not available. I went ahead and set it to 999 (tsUD105.UD105[0]["POLine_c"] = 999; //ttIR.POLine;), and did an early display before the error to take that question out of the equation, but it still gets the POLine is required error.
image

What if you comment out that line altogether? It should just initialize to 0.

another thought, can you change the message from from ex.message to just ex.ToString() ? That was we can see the whole exception.

1 Like

That’s because you set the tt value, not the UDtable value.

Also try setting your rowmod,. I don’t know if a new tableset has that set. I don’t know why there error would show up where it did, but it might just be the first one it tried. It needs to be “A”.

Edit: that’s not it. GetANew sets that when you get it.

Ok, thanks to your help I have found the issue. It came in setting the error display to display ex.ToString() instead of ex.Message. When the ToString() value was displayed, I saw it was Key2 that was the issue. When I first decided to use the UD table I had set extended values on the Key fields, then decided (after reading one of Jose’s posts here) to use (more descriptive) UD Fields instead. When @Jason_Woods had asked about Extended properties, I had completely spaced on the Key fields. I have removed the references and now the BPM works as expected. It is still not writing the UD105A (serial number) records, but I will work on that on my own or post a separate question later. I will bank the ex.ToString() method for future troubleshooting.

Before I accept an answer and mess it up, am I able to accept 2 answers? I would like to accept Jason’s as the correct answer from the beginning, but I wouldn’t have figured that out with Brandon’s display suggestion (and persistent work along the way).

Thank you both for your help!!

image

1 Like

You can give @Jason_Woods the solution. That’s technically what it was. I’m just glad I was able to help. I’m not a coder by trade, so I learn as much as I teach when I try to help figure this stuff out.

1 Like

Just a by the way, and for future reference, the message type was set by you in the code here.