This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - getting id from Part BOM

nx_plm - Monday, June 4, 2012 9:40 AM:

I want to get the Id from a Part Bom Item. When I execute the following code:

            Item partBom = inn.newItem("Part BOM","get");
            partBom.setAttribute("select", "related_id(keyed_name)");
            partBom.setProperty("keyed_name", "Part2.1", "like");

            Item result = partBom.apply();

I get 3 items, and the statement does not work as I suposed

How Can I get the Part BOM item which match a "related_id(keyed_name)" and keyed_name is Part2.1

 

Thank you

 

 



Boro - Tuesday, June 5, 2012 12:56 AM:

Hi

You can get related items with following code.

----

Item partBom = inn.newItem("Part BOM","get");

partBom.setAttribute("select","related_id");

 

Item part = inn.newItem("Part", "get");

part.setProperty("keyed_name", "Part2.1");

part.setAttribute("select", "keyed_name");

 

partBom.setRelatedItem(part);

 

Item result = partBom.apply();

----

Thanks.



nx_plm - Tuesday, June 5, 2012 6:53 AM:

It worked thank you very much, I was trying to get the attribute from the related_id property, but it was impossible to do it. Your solution worked for me.

I posted days ago a question related to AML script. Maybe you can give me also the clue.

http://www.aras.comhttp://www.aras.com/Community/forums/t/2452.aspx

Thank you again.



Boro - Tuesday, June 5, 2012 8:02 PM:

Hi,

Brian has already answered your past question. You can try it first, and I think it will work correctly.

Thanks