Detect DeleteRelation originDetect DeleteRelation originDetect DeleteRelation originGhassen Frikhahttps://www.adoxx.org/live/c/message_boards/find_message?p_l_id=&messageId=20815712021-03-02T10:10:25Z2021-03-02T10:08:01ZHello Community, <br /><br />I want to verify with the user before deleting an instance, if he dosen't want to proceed, the delete action will be aborted. <br />I am doing this with a QUERYBOX triggered with the <u>BeforeDeleteInstance</u> Event.<br />If wants to delete the exit result is 0, if no the exit is -1. <br /><br />The problem now is the relation connected to the object will be deleted automatically. (even if the delete action is aborted)<br />I tried to solve the problem with the two events (<u>deleteRelationInstance</u> and <u>discardRelationInstance</u>) <br />1 - store the relations in a map then recreate them. Then in the BeforeDeleteInstance, if the delete is confirmed, the instance and all connected relations will be deleted.<br />It's working but as a result, I can no longer delete a relation alone. (Well i know the solution is not optimized and not perfect) <br /><br />2- The second attempt is to recover the relation in the BeforeDeleteInstance Event.<br />If the delete instance action is aborted, the relation will be recreated. --> this will generate a system error.<br /><br />Is there a solution to detect the origin of the deleteRelation action (user OR system / script )..?Ghassen Frikha2021-03-02T10:08:01Z