Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Difference between nuActionSave and the Save in the action bar Topic is solved
-
- Posts: 338
- Joined: Sun Mar 14, 2021 8:48 am
- Location: Geneva
- Has thanked: 92 times
- Been thanked: 11 times
Difference between nuActionSave and the Save in the action bar
Hello,
I initially believed that nuActionSave() was equivalent to clicking the save button in the action bar. However, its behavior appears to be different, particularly when it comes to retrieving the RecordId() afterward.
Case 1: If I save manually using the action bar and then call RecordId(), I correctly get the ID of the saved record.
Case 2: If I trigger nuActionSave() from a custom button and then try to retrieve the record ID, it returns nothing.
Could you please explain why this difference occurs? Also, what would be the proper way to retrieve the saved record’s ID after using nuActionSave()?
Thank you,
Yves
I initially believed that nuActionSave() was equivalent to clicking the save button in the action bar. However, its behavior appears to be different, particularly when it comes to retrieving the RecordId() afterward.
Case 1: If I save manually using the action bar and then call RecordId(), I correctly get the ID of the saved record.
Case 2: If I trigger nuActionSave() from a custom button and then try to retrieve the record ID, it returns nothing.
Could you please explain why this difference occurs? Also, what would be the proper way to retrieve the saved record’s ID after using nuActionSave()?
Thank you,
Yves
-
- nuBuilder Team
- Posts: 4428
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 475 times
- Contact:
Re: Difference between nuActionSave and the Save in the action bar
Hi,
The record ID is shown for me:
The record ID is shown for me:
Code: Select all
nuAddActionButton(
'Run',
'Save Test',
'nuSaveAction()',
).css('color','green');
function nuAfterSave() {
alert('Record ID: ' + nuRecordId());
}
-
- Posts: 338
- Joined: Sun Mar 14, 2021 8:48 am
- Location: Geneva
- Has thanked: 92 times
- Been thanked: 11 times
Re: Difference between nuActionSave and the Save in the action bar
Hello Kev1n,
My nuSaveAction(true) is on a custom button in the edit form—not in the Action Bar.
When the save runs from that button, nuAfterSave() doesn’t fire as it fires with nuSaveAction() as opposed to nuSaveAction(true).
I use the true option as I need to close the popup at that moment.
Maybe just use nuSaveAction() without the true option. Is there a way to close the popup with another nubuilder option or do I have to use a javascript option like window.close()
Thanks again for your help.
Best regards,
Yves
My nuSaveAction(true) is on a custom button in the edit form—not in the Action Bar.
When the save runs from that button, nuAfterSave() doesn’t fire as it fires with nuSaveAction() as opposed to nuSaveAction(true).
I use the true option as I need to close the popup at that moment.
Maybe just use nuSaveAction() without the true option. Is there a way to close the popup with another nubuilder option or do I have to use a javascript option like window.close()
Thanks again for your help.
Best regards,
Yves
Last edited by yvesf on Mon Aug 11, 2025 7:55 am, edited 2 times in total.
-
- nuBuilder Team
- Posts: 4428
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 475 times
- Contact:
Re: Difference between nuActionSave and the Save in the action bar
I’m not seeing this issue when using a button with an onclick event calling
And in Custom Code:
It’s possible that some other code or settings in your form or setup are preventing the event from triggering.
nuSaveAction();
.And in Custom Code:
Code: Select all
function nuAfterSave() {
alert('nuAfterSave triggered!');
}
-
- Posts: 338
- Joined: Sun Mar 14, 2021 8:48 am
- Location: Geneva
- Has thanked: 92 times
- Been thanked: 11 times
Re: Difference between nuActionSave and the Save in the action bar
nuSaveAction(true)
doesn't fire nuAfterSave() after additionnal tests as opposed to nuSaveAction()
.-
- Posts: 338
- Joined: Sun Mar 14, 2021 8:48 am
- Location: Geneva
- Has thanked: 92 times
- Been thanked: 11 times
Re: Difference between nuActionSave and the Save in the action bar
Workaround :
weird but very efficient
Yves
Code: Select all
nuSaveAction();// to fire the nuAfterSave() function
nuSaveAction(true); // to close the popup
Yves
-
- nuBuilder Team
- Posts: 4428
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 475 times
- Contact:
Re: Difference between nuActionSave and the Save in the action bar
In nuUpdateData(), the form is closed if true is passed to nuSaveAction().
If you place
after the line nuFORM.edited = false;, then nuAfterSave() will also be executed.
If you place
nuProcessAfterSave();
after the line nuFORM.edited = false;, then nuAfterSave() will also be executed.
-
- Posts: 338
- Joined: Sun Mar 14, 2021 8:48 am
- Location: Geneva
- Has thanked: 92 times
- Been thanked: 11 times
Re: Difference between nuActionSave and the Save in the action bar
Just made the change without any impact
Yves
. Maybe I have to refresh smthgYves
You do not have the required permissions to view the files attached to this post.
Last edited by yvesf on Mon Aug 11, 2025 10:11 am, edited 1 time in total.
-
- nuBuilder Team
- Posts: 4428
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 475 times
- Contact:
Re: Difference between nuActionSave and the Save in the action bar
Did you log out, then log back in to nuBuilder?
-
- Posts: 338
- Joined: Sun Mar 14, 2021 8:48 am
- Location: Geneva
- Has thanked: 92 times
- Been thanked: 11 times
Re: Difference between nuActionSave and the Save in the action bar
yes but no real result. I cannot restart the web server as I am hosted by cybermania