Page 1 of 2
Custom Code Before Save
Posted: Sat May 08, 2021 3:49 pm
by BDemeuse
Hi,
I have created an
BrowseEdit Form to manage contact data.
I do not allowed change of names, only updates of other data (address...).
I have coded a BS with a display of error and it works BUT I would like to refresh the names with previous ones.
I am trying the
nuSetNuDataValue function and I have got the error
"undefined function" at execution.
So, first, what can I do ? as it is a nuBuilder function ? Version issue ???
And then, is it the right way to refresh the form ?
Thanks in advance.
ps: I am quite new in DB development on web also;
I am an old developer working for "charity organisation"

Re: Custom Code Before Save
Posted: Sat May 08, 2021 4:05 pm
by kev1n
Hi,
What's your nuBuilder version?
Re: Custom Code Before Save
Posted: Sun May 09, 2021 10:28 am
by BDemeuse
Hi,
NuBuilder 4.5.
Thanks
Re: Custom Code Before Save
Posted: Sun May 09, 2021 11:34 am
by kev1n
The exact version can be found in either version.txt or under Setup -> Tab Setup.
nuSetNuDataValue() was added on Feb 19, 2021.
Re: Custom Code Before Save
Posted: Sun May 09, 2021 12:51 pm
by BDemeuse
Hi,
DB Version: V.4.5-2021.01.28.00
Files Version: V.4.5-2021.02.07.00
So, it seems that i do not have the last version.
I need to upgrade.
Thanks!!
Re: Custom Code Before Save
Posted: Tue May 11, 2021 9:16 am
by BDemeuse
Hi,
Thanks. The upgrade has been done very easily

I am looking through all the posts and I cannot see answer to the following question (at least only pièces of solution

):
I want to refresh an edit form with older data (display error in cases of some data have been changed).
What should I do ?
-) JS on a specific event (on change ???)
-) are data reset via a nuSetDataValue ? or other ?
-) nuRefreshSelectObject() ? What is the object ? the form ?
Thanks in advance ... I am starting with web development, JS etc

But I am glad to use nuBuilder and be part of this community
Bri
Re: Custom Code Before Save
Posted: Tue May 11, 2021 9:28 am
by kev1n
If certain fields are not allowed to be edited, can't you just set them read-only?
Re: Custom Code Before Save
Posted: Tue May 11, 2021 6:17 pm
by BDemeuse
Hi,
I I set these fields as RO, I cannot create new data.
The use case is the following:
I have a browse-edit form to manage contact data (email, address, phone...) for persons where names are key.
I do not allow to change names as it is the key and refer to other tables.
If I set first name, last name as RO, I cannot create new contacts/persons as it is the same form

Re: Custom Code Before Save
Posted: Wed May 12, 2021 6:49 am
by kev1n
How about setting them RO only for existing (not new) records?
Re: Custom Code Before Save
Posted: Wed May 12, 2021 8:45 am
by BDemeuse
Hi,
How can I do this ?
Thanks
Bri