Validate UD field before saving Sales Order Line

Hey Guys

So I am sure that a version of the solution is already somewhere on here, but no matter how I search I can’t seem to find the solution I need…

Abbreviated version of my issue is this;

We are doing a custom to our Sales Order Entry Process and I am trying to put a Pre Process BPM on the BO that fires when you add a line to the Sales Order. Criteria is as follows:

For a Sales order Number to be created I have 3 required fields under the OrderHed Table (we need a sales order number to start a lot of the order entry process). However, before a user is able to add a line (which goes to the OrderDtl table) I have 5 UD fields under the orderhed table that I want to be filled/not null/mandatory.

I have done a trace on the process and my preference is to put a BPM on the

Erp.Proxy.BO.SalesOrderImpl
GetNewOrderDtl

So that a new line can’t even be started unless the fields have been populated. The closest I have come is a query condition on the fields, but after a line is added, I still get the exception when another line is added (and the fields are already populated)…I think I need to go the custom code route but my C+ knowledge is limited…

A swift kick in the right direction would be appreciated

Thanks

Put it on SalesOrder.Update so OrderHed is done before you start with lines… Something like this.

If you are On Premise, then use the Extended Properties to set the field as Required.

1 Like

So the extended properties would work…except we don’t always have all of the required information when we create the Sales order…we generally start work on projects before we have some of the required information that I want to make required before the line is created…not a normal situation I know.

So currently I have 3 required fields on the OrderHed table that have to be filled before a sales order number can be created. Once the order is created, I have 5 other fields that I want to be required BEFORE the line can be created…if I make those 5 fields required, they would be required before the Sales Order number can be generated right?

Hi Greg

So the issue I have here is that when I apply this to the SalesOrder.Update, it won’t let me generate the initial Sales order number without the second batch of required fields. What I have right now is 3 required fields that must be filled in order to generate a sales order number…this works fine. After the number is created, but BEFORE a line can be added I need to put the Exception in to look at 5 other fields…when I add this process to the Salesorder.Update, it won’t let me generate an initial order number if one of the 5 is blank…

Hi Adam,

For first 3 fields on header you have to check a Condition "OrderHead.RowMod == ‘U’ or OrderHead.RowMod == ‘A’ "
For 5 Fields on Detail Table you have to check a Condition "OrderDtl.RowMod == ‘U’ or OrderDtl.RowMod == ‘A’ "

It will allow you to check only the table you are updating data.

Thanks! I figured that it would have be put into code…so which Business object would I apply this to? and I assume that for the true/false condition I would have to pick the “Custom code is Valid” condition…as I mentioned my C+ skills are very basic right now…only just getting into that side of Epicor…

Try intransaction data directive with an exception thrown if it is not filled. It will not allow it to be saved unless the fields are entered. And also if someone tries to remove them at a later date.

Vinay Kamboj

Thanks Vinay

I did try that first, the issue I have is that the 5 extra fields I want to check are in the OrderHed table, but when the line is being added to the order, it is looking at the OrderDtl table…I can’t seem to get access to the OrderHed fields (to set them as the conditions) when I try to put an in-transaction DD on the Orderdtl table…

What about intrans on the Order Hed.

Vinay Kamboj

One of the conditions is to run a query.
I would do this on a pre-processing Method Directive for GetNewOrderDtl.

Hi Vinay, I have the same issue there, when I run it on the OrderHed table, I can’t pull in anything from the OrderDtl table…my condition would be “any added line on the OrderDtl Table” but It won’t let me pull from the OrderDtl…

which version of Epicor you are on?

10.1.500.9

Hey Jason

So I had gone down that route but could never seem to get it to flip between the True/False condition. This is what I have set up right now…can you point me in the right direction?

add more condition as you like to validation your ud fields.

Since you should not yet have an OrderDtl record, you don’t want the OrderDtl table at this point. The OrderHed table can be filtered by the variable OrderNum.

Jason Woods

Owner | Jason Woods Consulting

jason@jasonwoods.me

Cell: 360.903.4893

www.linkedin.com/in/jasoncwoods

http://jasonwoods.me

So I updated the query and removed the OrderDtl table…but I still receive the exception whether the field is Null or not…is my criteria incorrect?

I don’t see ttOrderHed.RowMod as an option under the table selection…

Insert Condition element and click new on bottom.