Hi,
Im trying to delete the grid item it check the Parent(part)condition if the condition is
not correct it need to prompt alert and delete the relationship item. For me it prompt the message but not deleting the grid item I put in (OnInsertrow) relationship grid event.
below code is not working..(removerelationship)correct me where im doing wrong.
debugger;
var myInnov=new Innovator();
var thisItem = parent.thisItem;
var tpart=myInnov.newItem("Part","get");
var parent_part_number = parent.thisItem.getProperty("part_no");
var child = thisItem.getItemsByXPath("//Item[@id = '" + relatedID + "']").getItemByIndex(0);
var x1 = child.getProperty("item_number");
if(x1!==parent_part_number)
{
//top.aras.AlertSuccess("Document Number is not as same as Part Number : " + x1);
alert("Document is not tally as Part Number" +"["+ x1+"]");
child.setProperty("thumbnail","");
child.setProperty("item_number","");
child.setProperty("major_rev","");
child.setProperty("pre_state","");
child.setProperty("generation","");
child.setProperty("state","");
thisItem.removeRelationship(child);
var objwin = top.aras.uiFindWindowEx(thisItem.getID());
if(objwin)
{
objwin.updateRootItem(parent.item);
}
}
else
{
}
But im not able to delete the child item. Im stuck here.If any one know correct me.
Thanks.