Can you not update the custom field values on the managed item tab via scripting?
I have been trying to pass information during the Modify Behavior script to update field values on the rows of the Managed Items (workflowItems object) and keep getting the error:
[BGE_AFRDServiceLog_EditUpdate] java.lang.RuntimeException: Unable to save script results
I only get this error during run time, script testing shows no errors
Here is the script:
if(item.SPAWNED_RFQ !== null)
{
for(var wfRow in item.workflowItems)
{
var wfLineItem = item.workflowItems[wfRow];
if (wfLineItem.RFQ === true && wfLineItem.MASTER_RFQ === null)
{
wfLineItem.MASTER_RFQ = item.SPAWNED_RFQ;
println(item.SPAWNED_RFQ);
}
}
}
Just note I am not trying to updated information on field in the linked item but on the custom fields in the managed items tab.
BD
Solved! Go to Solution.
Hi Bob,
Using the out of the box change orders workspace, I was able to call an action script on route change transition and update the disposition field to new value. The disposition field is a picklist and it is found in the managed items tab of my change orders workspace.
Is the state of your change order preventing you from updating the managed item field?
Regards,
Bob,
The following steps are working for me.
1. Create new change order
2. Add one affected item to change order, assign lifecycle and set revision value
3. Transition the change order to trigger action script that spawns new item in another workspace and write back new item descriptor into a PL field found on change order item details page if new item is not null
4. On modify of change order item, call another script to write item descriptor of new spawned item to managed item PL field
How many items are you spawning? And how many affected items do you have associated to your change order? Could it be that it stops working when you have more than one affected item?
Regards,
Bastien,
In your example below is step 4 “On modify of change order item” being triggered by step 3 or manually editing the item details?
I have tried two scenarios to get this to update: See the attached screenshot and notes
I can edit the record from the modify behavior script both in the Item details and the grid.
If I manually edit the item details with the managed items code active I get the same error. So I am stumped as to why I can’t edit the Managed Items fields?
Not sure if it is my syntax? I have also verified all my field spellings?
Oh I am currently only been testing with one item in the Managed Items Tab
BD
FYI
Also I can add to the PM tab from the modify behavior script when it is triggered by the wf action script editing the item details.
it is only the Managed Items tab;
My workspace is a basic workspace with workflow and the items added to the managed items tab are also from a basic workspace with workflow, they not being lifecycle changed by the workflow, in-fact I don't even have the Revision Value or Lifecycle state fields. Nor do I have a lifecycle defined for either workspace?
I am only using the managed items to create the relationship links and have custom fields, not form performing lifecyle management of the items added to the tab.
BD
Bob,
My step # 4 (On modify of change order item) is not manual. It is the workflow transition script that modifies the item.
I added the item.project.addTask to my on modify script and it is still not failing for me.
Let me escalate this to a support case and we can review your setup during a remote session.
Regards,
Bastien,
Thank you for working through the issue and helping me determine the cause was the computed field on my managed Item tab.
So currently we cannot add or update via scripting rows to the managed items tab when they contain computed fields.
Without your assistance I would have never been able to figure out this issue, it is good that Autodesk is monitoring this forum as it would have taken me twice as long to request a support case, as I figured I was setting things up incorrectly.
Thanks again.
Bob D