Fusion Manage Forum
Welcome to Autodesk’s Fusion Manage (formerly Fusion 360 Manage) Forum. Share your knowledge, ask questions, and explore popular Fusion Manage topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Updating custom workflowItems fields via Scripting

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
Anonymous
840 Views, 7 Replies

Updating custom workflowItems fields via Scripting

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

 

7 REPLIES 7
Message 2 of 8
bastien.mazeran
in reply to: Anonymous

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,

 



Bastien Mazeran

Technical Support Specialist

Message 3 of 8
Anonymous
in reply to: bastien.mazeran

Bastien,

As far as I can tell I have no permission restrictions or workflow
locking that would prevent the adding of Items to the managed Items. And
I can add them manually.

The sequence that this script is called is:

In the Managing Workspace (Change Order)
Work Flow Transition Script is triggered, which spawns a record in
another workspace and stores that reference in an item details field,
which is a picklist of records from the spawned workspace.

This edit to the item details then triggers the Modify Behavior Script
which takes the reference and copies the picklist selection to another
picklist field on the managed items tab (picklist is same picklist that
is on the item details field). This is done by processing each row in
the managed items object array and then setting the field to the
reference from the item details field.

So I don't know if I am running into a series of operations issue or
what?

BD
Message 4 of 8
bastien.mazeran
in reply to: Anonymous

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 Mazeran

Technical Support Specialist

Message 5 of 8
Anonymous
in reply to: bastien.mazeran

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

 

  1. Putting the managed Item PL Field Update in the modify behavior script (get error: [BGE_AFRDServiceLog_EditUpdate] java.lang.RuntimeException: Unable to save script results)
  2. Putting the managed Item PL Field Update in the WF Transition script, I get no errors but the WF rows are not updated, in Debug testing the debug prints indicate that those sections of code are running?

 

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

Message 6 of 8
Anonymous
in reply to: Anonymous

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

Message 7 of 8
bastien.mazeran
in reply to: Anonymous

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 Mazeran

Technical Support Specialist

Message 8 of 8
Anonymous
in reply to: bastien.mazeran

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

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report