Page 1 of 1

Edit a record on a nuPopup frame

Posted: Wed Aug 25, 2021 11:11 pm
by skyline101
HI

My attached graphic shows the edit section of a Browse and Edit form (Vendor Detail). At the bottom of it, I have a Run object with another Browse and Edit form (Partner List - OLD).

Question. What is the JavaScript needed on the Custom Code so if I were to click on any record from the Run object, it can bring the record on a nuPopup frame rather than the normal edit-breadcrumb?

I have tried the following custom code

Code: Select all

if(nuFormType() == 'browse'){nuPopup('myformid', 'pk', '');}
but when I click on any record on my Partner List - OLD run object, it does not do a popup, it just opens normally as a breadcrumb within the run object.

I have looked through the forums and tried different JavaScript functions, but I cannot get the record to do a popup.

Thank you for your help.

Re: Edit a record on a nuPopup frame

Posted: Thu Aug 26, 2021 2:18 am
by kev1n
Overwrite nuSelectBrowse

Re: Edit a record on a nuPopup frame

Posted: Thu Aug 26, 2021 7:48 pm
by skyline101
Hi Kevin

Thank you for your help.

I am leaving here the code I used so it can help anybody looking for it on the forums:

Code: Select all

function nuSelectBrowse(e){
    
    var r   = $('#' + e.target.id).attr('data-nu-primary-key');

    nuPopup('form_id', r, '');
}

Re: Edit a record on a nuPopup frame

Posted: Sat Jun 24, 2023 8:15 am
by ChrisW
skyline101 wrote: Thu Aug 26, 2021 7:48 pm Hi Kevin

Thank you for your help.

I am leaving here the code I used so it can help anybody looking for it on the forums:

Code: Select all

function nuSelectBrowse(e){
    
    var r   = $('#' + e.target.id).attr('data-nu-primary-key');

    nuPopup('form_id', r, '');
}
Hi Skyline101,

your code was not working for me, so I went to the nuSelectBrowse() and nuPopup(). Compared them and this one is working:

Code: Select all

function nuSelectBrowse(event, element) {
    const primaryKey = $(element).attr('data-nu-primary-key');
    nuPopup(nuFormId(), primaryKey, '', '');
}
Thanks for putting me in the right direction :-)

BR,
Chris