Hi All,
I have a question regarding script access to the managed items tab. I'd like to know if is possible to create a validation script that verifies that a lifecycle and revision is selected? I know that PLM now will prevent the "releasing" of an item that doesn't have these fields selected but I want to validate this earlier in the process (prior to attempting to release). I'm hoping tha last update on May 10 granted greater script access.
Please include the "objects" in your response i.e. item.MANAGED_ITEMS.xxxx.
Cheers!
Solved! Go to Solution.
Solved by broepke. Go to Solution.
Hi Orrin,
You can get this today via scripting. Here is a little sample. And via the debugger you can see the LC state is shown. Also; for any item where the state isn't set it will return as "null"
http://help.autodesk.com/view/PLM/ENU/?guid=GUID-BBBBAB3B-FEAE-4EB7-8D1B-29E76EC6BC65
See "item Workflow Items array"
Here is the code:
var itemLCState = "";
var i = 0;
for (i = 0; i < item.workflowItems.length; i++) {
itemLCState = item.workflowItems[i].lifecycle;
}
Brian,
What about the "from" and "to" revision fields in the managed items tab? Orrin's original question asked about revision but the solution did not address that. I would like to be able to read and write the "to" revision field. We use manual revisioning so that we can use both numeric and alpha schemes. I would like to be able to populate the "to" field with the appropriate number or letter revision based on our rules. To do that I need to know what revision we are coming "from", apply my rules, then write the new "to" revision. I can write the script easily enough if I have access to the "from" and "to" fields in the managed items tab. Thoughts?
Ty,
Presently, scripting engine allows r/w access only to "lifecycle" and custom_field_id(s).