I need to store three UD fields on the parts form: 1) custom_price, 2) date_updated, 3) updated_by
I currently have date_updated and updated_by disabled on the form
I have a Pro-Processing Part.Update BPM that sets date_updated and updated_by
What I need now is to do the following:
If custom_price has changed, update date_updated and updated_by
If custom_price is erased, simply clear date_updated and updated_by
Question:
What would my workflow be to have a condition on the updated_price? That is, a check to see if “existing custom price” != “new custom price”, then update date_updated and updated_by
A combination of pre-processing and post-processing? The use of defined variables in the pre-processing BPM?
You could just use 2 conditions
One that says if the custom_price is changed from any to 0 - clear your stuff
After that one (if it is false), one that says if the custom_price is changed from any to another - update your stuff
Thank you. I did that and the BPM is mostly working. The issue I have now is this: When the price is set to zero, I want to clear the user and clear the date. The user is being cleared, but the date is not. I have “set the date field of changed row to null”, but that doesn’t clear the date. Any ideas on how to clear this datetime field?
Are you 100 percent positive you’re going after the right row? When you show a msg box with the value of the changed row field(s), do they have values? Custom dates should be nullable with just setting them to null
I’m really new to these sort of customizations. I’m quite sure that I’m going after the right field because when I drop in BpmFunc.Date(1900,1,1) the field updates with the date 1/1/1900.
When I replace this function with DBNull.Value or null, the date never clears… it just stays the same.
Some searches online show that in C# DateTime is a non-nullable field. Does this sound right? Have any of you ever nulled a DateTime field after it has been populated?
As for change log and msg box suggestions, how would I go about looking at those?
create an in transaction data directive on the part table. pull in the change log module on designer and select the fields you want to track. from that moment on, it will tell you the time, date, user and before and after values.
here is my 2 cents:
Why not keep your date? There was a change on the row: The price was changed to 0. You have an info for the future if you need to know since when it was changed? and who did the change to 0!.
Line 1 shows changing price from 0 to 12, date is stored
Line 2 shows changing from 12 to 0, date shows as blank… YET the datetime field shows as unchanged on the form.
HOWEVER, if I clear the form and reopen the part the date field shows as blank. Why would the user field visually clear out, but not the date field??