Required field in UD1XX pre-processing BPM

,

I have fought with this all weekend and need a fresh set of expert eyes. I got help from @josecgomez last week creating a pre-processing BPM that fires on Erp.InspProcessing.InspectReceipt (from the Inspection Processing Save function) here: Add parent child data with full source. When the BPM attempts to write the UD105 table information on this line: UD105.Update(ref tsUD105);, it passes back a ‘POLine is required’ exception. I can’t figure out why while writing a UD table this is being passed, so I was hoping someone here might point me in the right direction. Thanks!

Do you have any Extended Properties on UD105 or any BPMs?

1 Like

I created all the non-key information as UD fields on UD105, so yes, though I didn’t do anything with those extended fields other than add them using UD Column Maintenance and regenerating the DB. I also didn’t make any of them required. There are no other BPMs on UD105. Both good thoughts, thanks.

Could you send the full details of the error?

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