Custom Code Before Save

Questions related to customising nuBuilder Forte with JavaScript or PHP.

Custom Code Before Save

Unread postby BDemeuse » Sat May 08, 2021 11:19 pm

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" :-)
BDemeuse
 
Posts: 20
Joined: Mon Apr 12, 2021 10:39 pm
nuBuilder Version: 4.5

Re: Custom Code Before Save

Unread postby kev1n » Sat May 08, 2021 11:35 pm

Hi,

What's your nuBuilder version?
kev1n
nuBuilder Team
 
Posts: 2012
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Custom Code Before Save

Unread postby BDemeuse » Sun May 09, 2021 5:58 pm

Hi,

NuBuilder 4.5.
Thanks
BDemeuse
 
Posts: 20
Joined: Mon Apr 12, 2021 10:39 pm
nuBuilder Version: 4.5

Re: Custom Code Before Save

Unread postby kev1n » Sun May 09, 2021 7:04 pm

The exact version can be found in either version.txt or under Setup -> Tab Setup.
nuSetNuDataValue() was added on Feb 19, 2021.
kev1n
nuBuilder Team
 
Posts: 2012
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Custom Code Before Save

Unread postby BDemeuse » Sun May 09, 2021 8:21 pm

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!!
BDemeuse
 
Posts: 20
Joined: Mon Apr 12, 2021 10:39 pm
nuBuilder Version: 4.5

Re: Custom Code Before Save

Unread postby BDemeuse » Tue May 11, 2021 4:46 pm

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
BDemeuse
 
Posts: 20
Joined: Mon Apr 12, 2021 10:39 pm
nuBuilder Version: 4.5

Re: Custom Code Before Save

Unread postby kev1n » Tue May 11, 2021 4:58 pm

If certain fields are not allowed to be edited, can't you just set them read-only?
kev1n
nuBuilder Team
 
Posts: 2012
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Custom Code Before Save

Unread postby BDemeuse » Wed May 12, 2021 1:47 am

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 :-(
BDemeuse
 
Posts: 20
Joined: Mon Apr 12, 2021 10:39 pm
nuBuilder Version: 4.5

Re: Custom Code Before Save

Unread postby kev1n » Wed May 12, 2021 2:19 pm

How about setting them RO only for existing (not new) records?
kev1n
nuBuilder Team
 
Posts: 2012
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Custom Code Before Save

Unread postby BDemeuse » Wed May 12, 2021 4:15 pm

Hi,

How can I do this ?
Thanks

Bri
BDemeuse
 
Posts: 20
Joined: Mon Apr 12, 2021 10:39 pm
nuBuilder Version: 4.5

Next

Return to Custom Code

Who is online

Users browsing this forum: No registered users and 6 guests

cron