Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Button to open edit form from SubForm

Questions related to using nuBuilder Forte.
Post Reply
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Button to open edit form from SubForm

Unread post 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.
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Button to open edit form from SubForm

Unread post 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.
You do not have the required permissions to view the files attached to this post.
treed
Posts: 205
Joined: Mon May 18, 2020 12:02 am
Been thanked: 2 times
Contact:

Re: Button to open edit form from SubForm

Unread post 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!!!
Post Reply