Forum Discussion

haider's avatar
haider
Ideator III
3 years ago

Deletion of an item

Hello I want to delete an item programmatically which can potentially be linked to 17different items throughout Aras via relationships which can be 1;1 or 1:m. I can delete it via querying all the 17 relationships  but is there a shorter way where I can just get all those relationships via code in a more dynamic way. So that later if a new 18th relationship with this item is created to another item the code does not need an update.

2 Replies

    • Gopikrishnan's avatar
      Gopikrishnan
      Accelerator II

      Hi Haider

      You can use action getItemWhereUsed to get the where used of an item programmatically and iterate the result and delete.

      <AML>
      <Item action="getItemWhereUsed" type="{ItemType}" id="{ID of the Item}"></Item>
      </AML>

      Thank You