All,
I am trying to "edit"/"update" the properties on a Non-Related Relationship; "rh_OraMfgMaster_ProdNumNomen".
I must be missing something.
I tried the following AML from AML Studio:
<AML>
<Item type="rh_Oracle_Manuf_Master_Item" action="edit" id="C323F3AB54D84E70B54D895158EE3CB7">
<Relationships>
<Item type="rh_OraMfgMaster_ProdNumNomen" action="edit"
where="[rh_OraMfgMaster_ProdNumNomen].source_id = 'C323F3AB54D84E70B54D895158EE3CB7'">
<RH_PRODUCT_CATEGORY_CODE>Z</RH_PRODUCT_CATEGORY_CODE>
<RH_TRADE_BRAND_CODE>F</RH_TRADE_BRAND_CODE>
</Item>
</Relationships>
</Item>
</AML>
<AML>
<Item type="rh_Oracle_Manuf_Master_Item" action="edit" id="C323F3AB54D84E70B54D895158EE3CB7">
<Relationships>
<Item type="rh_OraMfgMaster_ProdNumNomen" action="edit" id="3A40258510F24D1685B044270F4B296A">
<RH_PRODUCT_CATEGORY_CODE>Z</RH_PRODUCT_CATEGORY_CODE>
<RH_TRADE_BRAND_CODE>F</RH_TRADE_BRAND_CODE>
</Item>
</Relationships>
</Item>
</AML>
This does not work.
I tried [Item type="rh_OraMfgMaster_ProdNumNomen" action="update"] and that did not work.
I can delete the existing Relationship using:
<AML>
<Item type="rh_Oracle_Manuf_Master_Item" action="edit" id="C323F3AB54D84E70B54D895158EE3CB7">
<Relationships>
<Item type="rh_OraMfgMaster_ProdNumNomen" action="delete" id="A9BB4FEB593F4D09A5427B108937B216">
</Item>
</Relationships>
</Item>
</AML>
And then Add a new Relationship instance (with 'hasProdNomen ' = "NO") with the updated data.
let hasProdNomen = HasProductNomenclature(parentId);
let arasAction = "edit";
if(hasProdNomen === "NO"){ arasAction = "add";}
//let oracleMasterItem = inn.getItemById("rh_Oracle_Manuf_Master_Item",parentId);
let prodNumNomen = inn.newItem("rh_OraMfgMaster_ProdNumNomen", arasAction);
if(hasProdNomen === "YES"){
prodNumNomen.setAttribute("Where", "[rh_OraMfgMaster_ProdNumNomen].source_id = " + parentId);
}
prodNumNomen.setProperty(itemProductNumberPropName, prodNumItemNumber);
prodNumNomen.setProperty(tradeBrandPropName, tradeBrand);
prodNumNomen.setProperty(tradeBrandCodePropName, tradeBrandCode);
prodNumNomen.setProperty(productCategoryPropName, prodCategory);
prodNumNomen.setProperty(productCategoryCodePropName, prodCatCode);
prodNumNomen.setProperty(numberOfPositionsPropName, numberOfPositions);
//let prodNumNomenCnt = prodNumNomen.getItemCount();
//debugger;
let cnt = -1;
let prodNumNomenCheck = null;
if(hasProdNomen === "NO"){
//debugger;
item.addRelationship(prodNumNomen);
item.apply();
} else if(hasProdNomen === "YES"){
prodNumNomenCheck = prodNumNomen.apply();
cnt = prodNumNomenCheck.getItemCount();
}
But I would rather update the properties on the Relationship item.
Thanks for the help.
Scott