- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have a big problem in one of our script, a very important one because it avoids lot of manual work for our data manager. This script in an action script at the end of the Change Request workspace. Basically, it creates a change order in the Change Order workspace and copies/pasts all the affected items of the change request to the new change order generated.
The script is too long when you have more than 70 items in the affected items tab. I remember that a script cannot exceed 8 seconds or it fails (but it is an old memory from my FLC training). Here the script ran 10s (see attachment).
I have check different topics about it but there is no solution:
- https://forums.autodesk.com/t5/fusion-lifecycle-forum/script-time-out-error/m-p/6358537/highlight/tr...
- https://forums.autodesk.com/t5/fusion-lifecycle-forum/script-ran-too-long/m-p/4311669/highlight/true...
Put the following script in the library does not solve it:
// We create an Item Change Order only if it is needed
function closeItemsDR(){
if(item.RELATED_CHANGE_ORDER === null){
var newProperties = [];
newProperties.TITLE = item.TITLE;
newProperties.RELATED_DESIGN_REVIEW = item;
var newItem = createNewItem('WS_CHANGE_ORDERS', newProperties);
item.RELATED_CHANGE_ORDER = newItem;
// loops through all the related items and adds that item to the managed items tab of the ECO
for (i = 0; i < item.relationships.length; i++) {
newItem.workflowItems.addItem({RELATED:item.relationships[i].item});
}
}
}
Thank you for your help,
Cheers,
Sylvain
Solved! Go to Solution.