Force write to Audit Log

Hey guys,

Is there a way to force an event to write to the audit log via scripting? Like if I have a editable table that only certain people can edit, can I log if people try to edit it that can’t? Right now I have it throw up a error message but it would be nice if I could also log that to the audit log so I have a record of it.

You can put a click event on the table so that you can execute a script, but you have to make sure the security restriction for “disable events” is unchecked. In the script you can run an insert query into audit_events (or whatever you decided to name the audit table), and using some condition checks and client tags, you can write user info to the database depending on which user clicked on the table.