Forum Discussion

majorbyte's avatar
majorbyte
Ideator I
8 years ago

Purge and float

Hi, I create Itemtype A and B, both are version controlled and A has B as an item property defined as float. I create an instance of both and relate instance B to instance A. I modify both multiple times so they both go up several generations. When I purge instance A it goes to the previous generation with still referencing the latest generation of instance B. When I purge instance B I get an error instead stating that that specific generation of instance B is still referenced by instance A. 1. what is the Aras standard way of dealing with this situation? 2. what is the Aras standard way of dealing with a similar situation, but instead applied on relationship itemtypes? I'm having a hard time finding information on how to deal with the above 2 situations. Regards, /MB

1 Reply

  • Hi Majorbyte, There are a few different options here. I believe you could instead define the Item property to be fixed. With a Fixed behavior, each version of A will maintain a reference to a specific version of B. Doing this, when you purge instance A back to a previous generation, it will no longer be referencing the latest generation of B. It will be referencing the same generation of B that it did when the new version of A was created. An alternative solution would be to add an onBefore server event to ItemType B that updates any references to the latest generation of B to the previous generation. I believe you would want to use an onBeforeDelete server event and add a check to make sure that the action is purge using code like.
    string action = this.getAction();
    if (action == "purge") {
    // Update references to previous generation
    }
    Chris
    Christopher Gillis Aras Labs Software Engineer