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: 

Are there any reserved words for Field ID

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
515 Views, 4 Replies

Are there any reserved words for Field ID

I am having a problem with a script that is supposed to access the project management items.

 

When I run the below script segment it says (There is an error in the script on line 14, column 0. TypeError: Cannot read property "length" from undefined) Line 14 is the for loop.

 

Is it because I have a field id on the "Change Order" item called "PROJECT".

 

Is 'PROJECT' a reserved work?

 


// See if design review is referenced in change order. Otherwise add to project managment TAB.
var found = false;
if (item.CHANGE_ORDER !== null){
  for (var i=0;i<item.CHANGE_ORDER.project.tasks.length;i++) {
    if (item.CHANGE_ORDER.project.tasks[i] === item) {
      found = true;
    }
  }

  // Add item to change order
  if (found === false) {
    item.CHANGE_ORDER.project.addTask(item);
  }
}

 

 

4 REPLIES 4
Message 2 of 5
gasevsm
in reply to: Anonymous

We will check for this..

In meantime, is the proj mgmt tab of the change order accessible by the user running the script?

As a test, kindly check if item.CHANGE_ORDER is defined by adding to your first IF statement checking for null:

If( [...] && item.CHANGE_ORDER !== undefined)

Lastly, are you in position to temporarily unassign the field 'PROJECT' from change order's ItemDetails tab in workspace admin area to test if it is indeed conflicting with item.CHANGE_ORDER.project object?

HTH,
--
Martin Gasevski | Product Manager | Autodesk PLM 360

Martin Gasevski | Fusion 360 Team Product Manager
Message 3 of 5
Anonymous
in reply to: gasevsm

The project mgmt. tab is accessible and I can add to it from the UI.



Item.CHANGE_ORDER is defined.

When I do a println on it I get the Descriptor of the change order.



Not sure what you mean by unassign. My license don't give me the sandbox.



Thanks,

Sten
Message 4 of 5
gasevsm
in reply to: Anonymous

In Administation > Workspace Manager > Change Order > Item Details > move the PROJECT field from left most ItemDetails panel to the middle unnasigned panel.
Save the layout and test your script again and report findings please.
When done testing, just move the PROJECT field back to assigned left most panel. Save layout again.
Thank you,
--
mg




Martin Gasevski | Fusion 360 Team Product Manager
Message 5 of 5
Anonymous
in reply to: gasevsm

I tried this, but it did not make a difference.

I moved the PROJECT field to the unassigned column and saved, but when I execute the following line in my script:
println(item.CHANGE_ORDER.project)
I just get the Descriptor of the change order.

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

Post to forums  

Autodesk Design & Make Report