Page 1 of 1

Programmatic audit trail item?

Posted: Tue Nov 19, 2013 9:51 am
by asccloutier
Is it possible to programmatically add items to the Audit trail?

Globals.AuditTrail.????

I want to log some PLC changes (panel push button) to the HMI audit trail and I thought I could use the value change handler. I know that data loggers are typically used for PLC values but in this case I would really like to have them in the audit trail.

Thanks.

Aaron

Re: Programmatic audit trail item?

Posted: Tue Jan 21, 2020 4:03 pm
by Russ C.
Audit trail actions can be added manually in scripting using these methods:

Code: Select all

        void LogAction(string objectName, string eventName, string action, string actionObjectName, string actionInstanceName, string description);
        void LogAction(string objectName, string eventName, string action, string actionObjectName, string description);
        void LogAction(string objectName, string eventName, string action, string actionObjectName);
        void LogDataItemChanged(string dataItemName, VariantValue valueBefore, VariantValue valueAfter);
        void LogDataItemChanged(string dataItemName, string description, VariantValue valueBefore, VariantValue valueAfter);
        void LogMessage(string message);
        void LogMessage(string message, string description);
        void LogMessage(string message, string description, string userName);

Code: Select all

Neo.ApplicationFramework.Generated.Globals.AuditTrailService.LogMessage("My Custom Audit Trail Message")