I am trying to copy value of the property (rfq_number) from the parent item to relationship. On the parent item it is a ‘string’ and on relationship it is an ‘item’. Another property that I am copying (product_type) is a “list” on both “parent” item and “cild”
So here is a method that is executed on relationship “OnInsertRow”
var thisItem = parent.thisItem;
var rfq_number = parent.thisItem.getProperty("rfq_number");
var product_type = parent.thisItem.getProperty("product_type");
var child = thisItem.getItemsByXPath("//Item[@id='" + relatedID + "']").getItemByIndex(0);
child.setProperty("rfq_number",rfq_number);
child.setProperty("product_type",product_type);
var objwin = top.aras.uiFindWindowEx(thisItem.getID());
if (objwin) {
objwin.updateRootItem(parent.item); // refresh grid with new entries
}
When I insert a new relationship both values are show up, but when I save the "parent" the rfq_number disappears on the "child".
The rfq_number property is a "string" on the parent and an "item" on the child
The product_type property is a "list" on the parent and the child
What do I do wrong?
Thanks for your help
Yelena
As you stated, rfq_number is an item property on the relationship. So you must set it to the ID of the parent item, not the rfq_number from the parent item. If you do this then Innovator will display the keyed_name of the parent item on the relationship grid. In general, when a property is an Item property and it contains the ID of an item, Innovator will display the keyed_name of the item on Forms and Grids. I suspect that the keyed_name for the parent item contains the rfq_number.
Terry Stickel, PDM Consultant
TStickel Consulting
Sanibel, Florida
Terry,
Thank you for reply. Could you please help me with the code?
Should It be
var rfq_number = parent.thisItem.getPropertyAttribute("rfq_number","ID");
var rfq_number = parent.thisItem.getID()
The getID() method will return the id of the item.
Thanks again for your help. I am a beginner in the Innovator methods development and your help is greatly appreciated