Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

Custom Code Before Save

Questions related to customising nuBuilder Forte with JavaScript or PHP.
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

Custom Code Before Save

Unread post 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" :-)
kev1n
nuBuilder Team
Posts: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 times
Contact:

Re: Custom Code Before Save

Unread post by kev1n »

Hi,

What's your nuBuilder version?
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Custom Code Before Save

Unread post by BDemeuse »

Hi,

NuBuilder 4.5.
Thanks
kev1n
nuBuilder Team
Posts: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 times
Contact:

Re: Custom Code Before Save

Unread post by kev1n »

The exact version can be found in either version.txt or under Setup -> Tab Setup.
nuSetNuDataValue() was added on Feb 19, 2021.
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Custom Code Before Save

Unread post 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!!
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Custom Code Before Save

Unread post 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
kev1n
nuBuilder Team
Posts: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 times
Contact:

Re: Custom Code Before Save

Unread post by kev1n »

If certain fields are not allowed to be edited, can't you just set them read-only?
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Custom Code Before Save

Unread post 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 :-(
kev1n
nuBuilder Team
Posts: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 times
Contact:

Re: Custom Code Before Save

Unread post by kev1n »

How about setting them RO only for existing (not new) records?
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Custom Code Before Save

Unread post by BDemeuse »

Hi,

How can I do this ?
Thanks

Bri
Post Reply