In the “Corrective Action” module/form, I am trying to construct a BPM whereby, if a user does not enter a value in the “Assigned To” field (DMRCorAct.AsigndTo), a notification appears to warn the user that this value is required. This BPM works - but - it still doesn’t prevent the user from saving that new corrective action record without an “Assigned To” value being applied/inserted.
What appears to be happening is, when the notification dialog box is cleared (by pressing the “OK” button), a new corrective action record is created anyway.
I actually want to prevent that from happening, unless a value is designated in the “Assigned To” field.
A BO trace suggests that the record update is occuring here:
<businessObject>Erp.Proxy.BO.CorrectiveActionImpl</businessObject>
<methodName>Update</methodName>
… which I’m interpreting as a Method Directive, however, the [DMRCorAct] table is being called during the update process, as evidenced by this portion of the trace:
<changedValue tableName="DMRCorAct" rowState="Added" rowNum="0" colName="AsigndTo"><![CDATA[]]></changedValue>
… which leads me to believe that I’m dealing with a Data Directive, so I’m a little confused on that one.
I opted to go the Data Directive route and built my conditional logic around the “ttDMRCorAct.AsigndTo” field, where, if that field of the added row is equal to “”, then (throw messagebox dialog). Nothing follows the custom code block that presents the messagebox in the BPM.
The two questions I have are:
-
Is the Data Directive the appropriate handler
-
There must be more to it than presenting a simple message box to the user so, how do I actually prevent the record from being created?
Here is a small screen capture for reference: