Page 1 of 1

New Record Button & Tab

Posted: Mon Jun 20, 2022 10:36 am
by acroporax
Hi,

First, I added new button in edit form.

Code: Select all

if (nuFormType() == 'edit') {
   nuAddActionButton('new', 'Add New Record', 'nuAddAction();'); 
}
This code works but constantly opens a new form.

Image



Second, How to set TAB to sort?

Re: New Record Button & Tab

Posted: Mon Jun 20, 2022 11:56 am
by kev1n
Hi,

Use nuForm() instead to open a new record in the current Breadcrumb:

Code: Select all

function newRecord() {
    if (nuIsSaved()) {
        nuForm(nuFormId(), '-1', '', '', '1');
    } else {
        nuMessage('The current record must be saved first');
    }
}

nuAddActionButton('new', 'Add New Record', "newRecord();");

Re: New Record Button & Tab

Posted: Mon Jun 20, 2022 11:58 am
by kev1n
May I ask you to ask separate unrelated questions in separated topics? Thanks.

Re: New Record Button & Tab

Posted: Mon Jun 20, 2022 12:03 pm
by acroporax
kev1n wrote: Mon Jun 20, 2022 11:58 am May I ask you to ask separate unrelated questions in separated topics? Thanks.
Sorry,

Thanks for answer.