Hello,
I am trying write a script to spawn an item in a different workspace, add the newly spawned item to the original item's Managed Items Tab, and update the lifecycle of the new item to "Initial Design Revision". The whole script works except updating the lifecycle.
According to everything I've read, this should work:
var NewPartsAndBom = createNewItem('WS_PARTS_AND_BOM', newProperties);
var NewManagedItem = item.workflowItems.addItem({RELATED:NewPartsAndBom});
item.workflowItems.lifecycle = 'Initial Design Revision';
When the script runs, this is the error message: java.lang.NullPointerException: null
If I comment out "item.workflowItems.lifecycle = 'Initial Design Revision'; " there are no error messages.
Help would be much appreciated,
Harper
Solved! Go to Solution.
Solved by gasevsm. Go to Solution.
Try to change "item.workflowItems.lifecycle = 'Initial Design Revision';" to
"item.workflowItems[i].lifecycle = 'Initial Design Revision';"
With this code:
NewManagedItem.lifecycle = 'Initial Design Revision';
I am getting this error: java.lang.NullPointerException: null
With this code:
NewManagedItem.workflowItems.lifecycle = 'Initial Design Revision';
I am getting this error: TypeError: Cannot set property "lifecycle" of null to "Initial Design Revision" (Create_Item_Parts_BOM_no_SAP#50)
I also played around with using "[i]" with no success. If I am missing something obvious, let me know, otherwise please direct me on how to raise a support ticket.
I work for a reseller and it does not seem that I have the ability to create a support ticket. Specifically, I do not have the option to click "View my support cases" - step 3 in the guide you shared. How should I proceed?
Harper - as a reseller, you can request technical assistance via Partner Center. Are you able to access that? If not, I'll open a case with Customer Care and have someone review your account.
Thanks,
Michelle
I do not have access, but I believe it is an issue on our side. I don't think a Partner Center account was created for me. I will get with someone in IT to figure that out.
My coworkers can access it, so once in Partner Center, how can we create support tickets?
Looks like there's an option for the customer to grant you access for viewing their cases: Setting Reseller Permissions for Viewing Cases. For logging cases yourself, it would be through the normal flow for Submitting and Viewing Support Requests.
Thanks,
Michelle
Hello,
We are having the same problem as described initially. We have a script that adds a Managed Item to a WS, but we cannot get the Lifecycle to populate (ideally we would like to also populate the Effectivity, To and From). Please see code below:
function createNewItem(wsID,propertiesArray) { newItem = createItem(wsID); for(var propKey in propertiesArray){ newItem[propKey] = propertiesArray[propKey]; } var wfItem = newItem.workflowItems.addItem({RELATED : newItem}); wfItem.lifecycle = 'Publish New Document'; }
The relationship is getting created (i.e. when we execute the script, the system creates the new Item, and it adds the linkage in the Managed Items. The problem is that the Lifecycle remains blank. The error we get is:
[Generate_Document_Change_Order] java.lang.NullPointerException: null
Hi Wendy,
Updating EffectivityDate and To: (IFF using manual rev scheme) isn't available presently via scripting. Setting the lifecycle transition name via script is expected and designed to work; if you are having issues with this, kindly raise a support ticket to triage this matter. you shouldn't get a null exception, that is for sure.
I'm having the exact same issues. item.workflowItems.addItem(); does not return an object. Nor does it add the new item to the beginning or the end of array workfItems array. It adds it in alpha numeric order. So it potentially it could be in position 0, 3, 2 or .length -1.