Skip to main content
1-Visitor
December 17, 2014
Solved

Add a Custom Attribute to a specific task in Workflow

  • December 17, 2014
  • 1 reply
  • 6720 views

Is there an easy way to add a custom attribute only to a specific task in a workflow? For example, in the OOTB Change Notice workflow there is an Audit task. How would I add an attribute to this task only?

-Ryan

Best answer by kpritchard

ok then change the set statement to

obj.set("IFRQ_Number", IFRQ_Number);

1 reply

12-Amethyst
December 18, 2014

You can create variable in Task:

1.jpg

rhermann1-VisitorAuthor
1-Visitor
December 18, 2014

Awesome. I actually got this far on my own. Next I want to take that variable information and map it back into an attribute on the change notice that way it is visible on the details of the change.

Any idea what the code for this is?

1-Visitor
December 18, 2014

It ends on what version you're on... LWCNormalizedObject is the API to use for earlier versions, for 10.2 and beyond use PersistableAdapter. See the JavaDoc for your version for code samples