Hi,
I have written a script which tryes to add BOM on modifying of "Items and BOMs" item.
No errors during the testing in PLM360 UI. But I have an error during real execution. We have created a .NET application where we have an error "At least one of the input values was set to an illegal value."
BOM part of script:
var item1 = loadItem(2998); var res= item.boms.addBOM({RELATED:item1, QUANTITY:1});
Item with id 2998 is real.
Additionally we have a message from View Log: [SLDOnModify] java.lang.NullPointerException: null.
We see the error because of second string (var res= item.boms.addBOM({RELATED:item1, QUANTITY:1});). If line commented, the error will be disappeared.
So I can't add item at the BOM of item which I try to modify. Do you know where the problem can be?
Best regards, Vitaliy
Hi Vitaliy,
Here is my simple script that will allow you to write to the BOM Tab.
See Attachments for reference.
This action script can be utilize in the behavior setting or the workflow.
if(item.BOM_LINK !== null){
item.boms.addBOM({
RELATED: item.BOM_LINK,
QUANTITY: 1,
ITEM_NUMBER:1
});
}
thanks,
Trung
The item number must be specified in the addBOM function, so try this and replace # with your item number.
var item1 = loadItem(2998); var res= item.boms.addBOM({RELATED:item1, QUANTITY:1, ITEM_NUMBER:#});
Can't find what you're looking for? Ask the community or share your knowledge.