Updating User Defined Fields through BPM Method Directive

I have a simple method Directive starting on SalesOrder.ReopenOrder that sets ttOrderHed.OrderHeld of all rows to true and is followed by invoking Erp.SalesOrder.UpdateExistingOrder. It works perfectly.

Now I want to also set my ud field ttOrderHed.Status_Deposit_c to “Reopened”. It appears to work until I add a new line and save, at which point the ud field reverts to its previous setting.

Experimenting reveals that the bpm will correctly save any field from OrderHed but not OrderHed_UD.

What have I missed?

Have you checked to make sure the data tables are in sync? (ie, did you forget to regenerate the DB after adding the UDF) That’s my only guess, I update UD fields all the time in BPMs without issues.

What is the code you are using to set the UD field on the tt table?

From the ICE guide …

  1. Method directives work with temporary (tt) tables using tablesets, and so you access them through different syntax. These tablesets are defined in the business object’s (BO) contract .dll file, so their format is fixed and they are not regenerated with the data model. When building a method directive that refers to user-defined fields in temporary tables, reference them using the [“UDField<>()”] syntax. For example:
ttABCCode.UDField<System.String>("MyNewColumn _c")
1 Like

In the BPM Workflow Designer I’m using Set Field to do the action “Set the ttOrderHed.Status_Deposit_c field of all rows to the Reopened expression.

Have you tried any other SalesOrder methods? Maybe just Update or UpdateExt could work?

Thank you for your tips and suggestions.

I solved the problem with a work-around. I found I couldn’t update any ud field using a method directive, so I updated UserChar1 instead. Then using a data directive
in-transaction I set the ud field. The results aren’t visible until after a line is added, but that’s okay as that’s why we reopen orders.

Best wishes to all for 2020!

ttABCCode.UDField<System.String>(“MyNewColumn _c”) is about querying the value.
ttABCCode.SetUDField<System.String>(“MyNewColumn _c”, value) method call should be used to set the value of UD field.

Or, just use SetField or UpdateTable actions as it suggested above.