Hello Alex,
Hope you’re well.
You did a decent job explaining the problem you’re having, but moving forward, attaching some images of the BPM you made will definitely be helpful to all trying to assist you.
After reading what you sent, I assume the issue is you aren’t using the correct method. You can see in the trace logs I provide that the “Update” is not being called upon creation of the record, the “GetNewOrderHed” and “MasterUpdate” is being called. Therefore any logic you are placing in the pre/post of Update isn’t being triggered.
For this problem, I would not use a Data Directive. A method directive is more clean. To find the method directive you need to attach your logic to, you should do a trace of the process, then look at the methods called.
When doing your first trace, don’t enable anything beside the first box. This will get you the bare minimum information to see the methods that are firing, as well at the types of data being sent to those structures. Here, you can find this:
“GetNewOrderHed” is the method that is called to actually create the OrderHed record. As you can see, one of the parameters it is passing is the “SalesOrderDataSet”. In this DataSet, is the OrderHed data. Inside there, if you enable “Write Full DataSet” in the trace logging, you will see your field, and the data:
This is one place you can put your logic. If you do put it here, be sure to use a “Pre” method directive. This will be sure the data changes you are made are committed to the database. If you select “Post”, that means the update has already committed the dirty rows to the DB, and you would need to call “Update” again.
Another place you could put the logic, is on the “MasterUpdate” which is called later, and also passes the SalesOrderDataSet, which will contain your “ReadyToCalc” field.
In both of these SalesOrderDataSets, you see the field you are interested in, as well as it’s current value of “true”:
Let me know if you need any other assistance, but this should take care of your issue. Have a great day!