Getting EntryNode values (multi occurences attribute)

23 Views Asked by At

How do I get values of Multi-Occurrences Attribute?

I have found a partial solution here, but am not clear with getting EntryNode.

https://www.ibm.com/support/knowledgecenter/en/SSWSR9_11.6.0/com.ibm.pim.app.doc/code/pimscript/pim_ref_writevalueruleformultiatt.html

1

There are 1 best solutions below

0
On

This is the part that returns always the same code:

rawCode=item.getEntryRelationshipAttrib("Product Master Catalog Spec/Raw Materials Details/Code");

That is because it always returns the first occurrence.   I think your code should look something like this:  

pnode = entrynode.getEntryNodeParent(); 
attribCode = pnode.getEntryNode("/Code").getEntryNodeValue();
//This returns the path with the # and the correct order.
attribCodePath = pnode.getEntryNode("/Code").getEntryNodeExactPath();
rawCode=item.getEntryRelationshipAttrib(attribCodePath);
rawmatCode = rawCode[1];
var rawCatalog = getCtgByName("Raw Material Catalog") ;
rawMatItem = rawCatalog.getCtgItemByPrimaryKey(rawmatCode);
rawMatCost = rawMatItem.getEntryAttrib("Raw Material Details Spec/Cost") ;
 
attribQty = pnode.getEntryNode("/Qty").getEntryNodeValue();
res=attribQty*rawMatCost;