Hi all,
I want to change the definitionof a workflow text/popup attribute in an event script, e.g. if the attribute has valid values {'a', 'b', 'c'} I want to change it to {'a2', 'b2', 'c2'} to test it. I've not found a way to do this yet.
I was already able to change the valuesfor a workflow text/popup attribute in an event script via:
Object obj = $WFMain.WFPackageSubsystem.GetItemByName( 'WFAttributes' )
RecArray array = $WFMain.WAPIPkg.LoadWorkData( prgCtx, work )
then use obj and array to search the record r with the USERDATA, then update the value of the attribute with ID id like this:
r.attribs.Content.RootSet.ValueTemplate.Values[ 1 ].(id).Values[ 1 ] = <another value>
Finally, save the attribute:
obj.SaveWorkData( prgCtx, work, Undefined, attribs )
I have already tried to change the definition by changing:
attribs.StepData.AttrDefinition.Children[id].ValidValues[1]
attribs.StepData.Content.RootSet.Children[id].ValidValues[1]
attribs.Content.RootSet.Children[id].ValidValues[1]
but the SaveWorkData method doesn't do anything with it (no errors but it does not update)!
Does anyone has an idea?