Detach a record - Validation - Forum - Rollbase - Progress Community

Detach a record - Validation

 Forum

Detach a record - Validation

This question is answered

Hello,

Is there a way I could catch the detach event of a related record? I have tried using a validate record data trigger to check for atleast one related record to be present before update but I'm still able to detach the related record. Is there a way I could stop this and throw an error?

Verified Answer
  • Hi,

    In 4.0.0.0, it is working fine and the release is targeted on Aug 22nd 2015 as of now.

    Thanks and Regards,

    Chandra.G

All Replies
  • Hi,

    We can achieve this by applying 'Validate Record Data' trigger on the top of related object. Means, select related object from 'On Field Change' drop-down and provide error message in  Formula editor. But, it will work for both attach and detach but not only for detach.

    One more thing, right now this case is not working as expected. Issue has been raised for the same. We will let you know once that is fixed.

    Thanks and Regards,

    Chandra.

  • ValidateRecordData_LookupFields.png

    Find attached screen shot.

  • The validation record data trigger doesn't run on detach of a related record for some reason. Is that a known problem? I have tried and checked it using the rbv_api.log() function and according to the log the trigger doesn't run on detach.

  • Hi,

    The behavior that I observed and logged an issue for the same.

    Note: I tried it in 3.1 release build

    -> Create couple of objects. (Ex: Obj1 and Obj2)

    -> Create any relationship between them (Ex: M to M)

    -> Create few records in both objects and link in between them.

    -> Go to any object definition (Ex: Obj1) and create a validation record data trigger where select related object from 'On Field Change' drop-down list and provide error message and select any timing option (Ex: Before Delete) and save it.

    -> Go to Obj1's record edit page and click save button without modifying anything.

    -> Observe that validate record data trigger got executed ant it is throwing error that we specified.

    -> It should not execute the trigger as we haven't attach/detach the related record. It should execute the trigger only when attach/detach the related record.

    Hope this helps.

    Thanks and Regards,

    Chandra.G

  • Ok we are using version 3.0.5.0. Can you try and do the same on the view page where we can detach an existing related record and check whether the trigger is firing? I have tried the above mentioned steps with a timing of "Before Update" on that validation trigger but it doesn't seem to run when I detach the related record. Am I missing something?

  • Hi,

    You are correct. The validate record data trigger on the top of look up field is not working in record details page.

    I have added this case as well to the issue.

    Thanks and Regards,

    Chandra.

  • Hello Chandra,

    Could you possibly tell me as to when can I expect a fix for this please?

    Cheers.

  • Hi,

    It is targeted for v4.0.0.0 release.

    The tentative release date is 18th April 2015

    Thanks and Regards,

    Chandra.G

  • Hello,

    Just coming back to my post as I am facing this issue again. May I know if this issue would be fixed in 4.0.0.0 release or would it be fixed in a later version? Kindly let me know.

    Cheers.

  • Hi,

    In 4.0.0.0, it is working fine and the release is targeted on Aug 22nd 2015 as of now.

    Thanks and Regards,

    Chandra.G