Set LockPrice to True when new line is created

I was tasked with making the OrderDtl.LockPrice variable to be true when a new line is created, and I am having some issues doing it. I tried looking for something related to automatically setting a variable to be x when something is created, but I could not find anything.

To start, I made a new rule in Order Entry application studio. It successfully changes lockprice to be true all the time. However, this will force the lockprice to be true all the time, instead of having it be on by default and able to be toggled. Is there a way to edit this so it will only set LockPrice to be true when creating the line?

When that did not work, I went to data directives. I created the following BPM, but this does nothing at all. As shown in the screenshots below, I made a condition to check if the added row of OrderDtl.LockPrice is false, then change it to true. I made sure to try both added and updated row for both the widgets in the BPM, and nothing worked. Any idea what could be wrong with this?


I think you have it using your Data Directive… but you’re coming off of your condition on the wrong side.

Condition is checking if the checkbox value is “false”.

If that condition is TRUE (the checkbox value IS “false”)… then change it to “true”.

Right now, you’re checking if it is false… which it is… but your set field appears to be coming off of the “false” side of the condition.

Move your Set Field to the “true” side of the condition.

image

2 Likes

Wow this was it! I never realized that it mattered where you put the connectors, guess I was lucky when creating BPMs before. Thank you for your help!

2 Likes

It seems like you’re looking to have the “Lock Price” field set to true automatically when a new line is created, but still want to have the option to toggle it later if needed.

In this case, it will be easy to use Method Directive. There is a method called “GetNewOrderDtl” under SalesOrder Business Object. Use post-processing for this and directly use set field widget to assign value to true. With that, you won’t need any condition as well.

@dcamlin’s solution is great too !

1 Like

Yup, that’s how you tell it to do specific things based on the condition results.

If the condition evaluates to TRUE… continue the process down the path on the left.

If the condition evaluates to FALSE… continue the process down the path on the right.

Feelings Pants GIF

2 Likes

Unfortunately, you can’t use this method directive to alter the first orderDtl that is made for the line, only additional.

I think it would be best to do both, as the first record is caught in the DD,
subsequent ones are defaulted from the method directive.

1 Like

Oh, that is nice to know. Thank you for this explanation.

1 Like