Welcome to the nuBuilder Forums!

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

Audit Trail Code - Before Save or After Save?

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
pmjd
Posts: 132
Joined: Fri Mar 12, 2021 10:38 am
Has thanked: 3 times
Been thanked: 1 time

Audit Trail Code - Before Save or After Save?

Unread post by pmjd »

Hello,

I've been implimenting this very useful code from forum members for implimenting a full audit trail in my nuBuilder project.
https://forums.nubuilder.cloud/viewtopic.php?f=20&t=9413
(I know that nulog is now available but this approach of being able to log all changes, including what they were and by who, is critical to my project.)

The code has been implimented in the form's Before Save field.

Question is, does this need to be in Before Save or is it just as effective if it is in After Save code section?

In the After Save section is give me additional access to more hash cookies to add to the audit trail.

Any thoughts on this appreciated,
Paul
kev1n
nuBuilder Team
Posts: 4304
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Audit Trail Code - Before Save or After Save?

Unread post by kev1n »

The code has to be placed in BS since it retrieves the values from the the table before saving the data and compares them to the values that were changed.
pmjd
Posts: 132
Joined: Fri Mar 12, 2021 10:38 am
Has thanked: 3 times
Been thanked: 1 time

Re: Audit Trail Code - Before Save or After Save?

Unread post by pmjd »

Ah, got it now. Makes perfect sense.
Post Reply