Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Check previous value

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
mih
Posts: 30
Joined: Thu Jan 26, 2023 12:04 pm
Has thanked: 3 times

Check previous value

Unread post by mih »

Is it possible to check previous (old) field value in BS and BD event handlers to make some rows in DB table unchangeable?

For now I think about retrieving values from DB and comparing, but maybe on client side (JS) or server (PHP) but without DB query.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Check previous value

Unread post by kev1n »

When the Before Save and Before Delete event handlers are triggered, nuBuilder does not store the previous field values in memory/in the session. Therefore, to check the previous value of a field, you must retrieve it from the database using a query.
mih
Posts: 30
Joined: Thu Jan 26, 2023 12:04 pm
Has thanked: 3 times

Re: Check previous value

Unread post by mih »

Thanks. Also I think about some hidden boolean field with "True' values means "PROTECTED" and set it by phpMyAdmin
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Check previous value

Unread post by kev1n »

Is this possible with phpMyAdmin?
Post Reply