delete xclass available on part through code
- 6 years ago
Hi
Create New Method and copy paste below Javascript code
var parentType = parent.item.getAttribute('type');
var xClassName = parentType + '_xClass';
var deleteItem = aras.newIOMItem(xClassName, 'get');
deleteItem.setAttribute('select', 'related_id(label)');
deleteItem.setProperty("source_id", this.getID());
deleteItem = deleteItem.apply();
for (i = 0; i < deleteItem.GetItemCount(); i++)
{
var xClassRel = deleteItem.getItemByIndex(i);
xClassRel.setAttribute("version","0");
xClassRel.apply("delete");
}Navigate to Administration --> Action
Create New action (Type = Item and Action = Client and Method = above created method)
Open Part Item type and add this action under Actions tab
Save and Unlock
Open any part and under actions you will see the newly created action
Reopen item to view the changes
Thank You
Gopikrishnan R