Clarity

 View Only
  • 1.  Unable to delete subobject rows from main object due to validations on sub object

    Posted Jul 05, 2019 09:03 AM

    Trying do delete row on main object . There are validations on the sub object which prevents the rows from getting deleted on the main and sub object.

     

    If we have a way of knowing that the delete came from the main object, we want to be able to delete the sub object rows without validations firing.

     

    Have you ever come across such a scenario?

    Regards,
    Benitha



  • 2.  RE: Unable to delete subobject rows from main object due to validations on sub object

    Posted Jul 05, 2019 11:10 AM
    Little confused about your question - regarding the "validations" - how are these implemented?


  • 3.  RE: Unable to delete subobject rows from main object due to validations on sub object

    Posted Jul 08, 2019 02:55 AM
    Hi David,

    The validations are implemented in trigger ob sub object and messages_en.properties file is used to display the validation messages. We do not want these messages on the sub object  to fire , when we delete rows from the main object.

    Regards,
    Benitha


  • 4.  RE: Unable to delete subobject rows from main object due to validations on sub object

    Posted Jul 08, 2019 10:29 AM
    OK so your validations are (unsupported) customisations - so you are unlikely to get a supported "fix" for your issue I would think.

    You need the code that you have written for your sub-object validation to be "aware" of how its has been called ; I'm not really sure how you would do that as I'm not even sure how the application cascades that delete instruction (so whether the application handles the delete of the sub-object when it is processing a delete of the master-object OR whether it just relies on a cascade delete at database level).

    Assuming you have a trigger on the master-object as well, perhaps you could set some custom-value against the master-object instance in that trigger which then allows your code in the sub-object trigger to ignore the validations on-delete there?

    (GUESSing though - you have a custom code issue problem to solve rather than an application one :( )


  • 5.  RE: Unable to delete subobject rows from main object due to validations on sub object
    Best Answer

    Broadcom Employee
    Posted Jul 10, 2019 02:44 PM
    In addition to what @David Morton said, if you are trying to determine in the trigger code if deletion is coming from main or sub object​ for your customization, I would recommend doing a SQL trace (action trace) and comparing the two actions of deleting, this could give you an idea on how to modify your code to distinguish between the two situations. I would also suggest to check with the person who developed the customization. 
    Lastly, perhaps there is a way to achieve your validations with a Clarity process, so you do not have to add database objects and triggers. This would be something that's supported, and can be more flexible.

    ------------------------------
    Principal Support Engineer
    Broadcom
    ------------------------------



  • 6.  RE: Unable to delete subobject rows from main object due to validations on sub object

    Posted Jul 08, 2019 10:29 AM
    Hi David,

    We have validations coded on the trigger in the sub-object and have updated messages_en.properties file to display these messages.
    We need to be able to delete the sub-object rows when we delete rows on the main object without the validations firing.

    Regards,
    Benitha