Page 1 of 1

Button to open edit form from SubForm

Posted: Tue Sep 08, 2020 6:58 pm
by treed
Hi All, I'm trying to open an edit form from a grid subform from the record it's on.
Selection_094.png
If I hard code the PK, ContactID (16) into the Record ID for the run button it opens the target form correctly. However when using the ContactID or Record_ID hash cookie the form opens blank.
Selection_095.png
Could someone tell me what to put in the Record ID field to make this work? Thanks.

Re: Button to open edit form from SubForm

Posted: Tue Sep 08, 2020 7:15 pm
by kev1n

Re: Button to open edit form from SubForm

Posted: Wed Sep 09, 2020 7:24 am
by kev1n
Instead of using a Run Object, use an Input Object and set its Type to Button. Add an onclick Event via its Custom Code Tab with the following Javascript.
input_button.png

Code: Select all

openContactListForm(event);
onclick.png
In your form's Custom Code field, add this function:

Code: Select all

function openContactListForm(event) {

    var et = $(event.target);
   
    var contactID = $('#'+et.attr('data-nu-prefix') + 'ContactID').val();

    nuPopup('5a29ddbd60e1aa9', contactID, '');
       
}

Replace 5a29ddbd60e1aa9 with the ID of your Contact List form.

Re: Button to open edit form from SubForm

Posted: Tue Oct 06, 2020 11:37 pm
by treed
Now that I understand the difference between a zzzzsys_form_id and a sfo_code things work as they are supposed to thanks!!!