Topic
1 reply Latest Post - ‏2014-01-02T22:11:32Z by pdubovitsky
9V4Y_archie_monico
9V4Y_archie_monico
1 Post
ACCEPTED ANSWER

Pinned topic Help Identifing selected child record

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

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
    pdubovitsky
    376 Posts
    ACCEPTED ANSWER

    Re: Help Identifing selected child record

    ‏2014-01-02T22:11:32Z  in response to 9V4Y_archie_monico

    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.

    Pavel