• 1 reply
  • Latest Post - ‏2014-01-02T22:11:32Z by pdubovitsky
1 Post

Pinned topic Help Identifing selected child record

‏2013-12-30T16:17:17Z | child records

I have a parent form that has a refernece_list on it (Children). On the parent form I have the normal buttons to "Add", "New", "Delete" children. What I am attempting to do is in the "Delete Hook for the button" for the reference_list. I do not want to allow them to delete if the child record is in a state of "Closed". How do I know what child record is selected to be deleted? Can someone please help me. Thanks in advance.

  • pdubovitsky
    376 Posts

    Re: Help Identifing selected child record


    Unfortunately, there is no way to determine selected record that would work for all environments: Windows, UNIX. CQWeb.
    Instead, you can check the list content before and after the button is clicked by setting pre- and post- action hooks on the button. If condition is not met, you can add removed record back to the list and throw error message that will be displayed to the user. Nevertheless, the view will not be updated (the record would seem to be deleted until the record is committed), and there is no way to force form refresh either.