writeAuditBatchEntry()

The function is used e.g. in production processes and it writes the batch id, the data point element the executed action had an influence on, the data point type, the executed action and the reason why the action was executed.

Synopsis

writeAuditBatchEntry(unsigned batchid,string item,string itemtype,string action,int &error,string reason = "");

Parameters

Parameter Description
batchid The id number of a process if a process number exists.
item The data point element the executed action had an influence on (e.g. string item = "prod_proc";).
itemtype The data point type. The type is, however, not shown in the Audit trail panel.
action The executed action (e.g. string reason = "Production process started").
&error

The returned error code

If the return code is 0 the error is OK

Error handling is not programmed.

reason = "" Reason why the action was executed. Default value is empty.

Return value

None

Errors

If the return code is 0 the error is OK. Error handling is not programmed.

Description

The function writeAuditBatchEntry is used to write information like batch id, action etc. (see parameters above) into the Audit trail panel.

Example

The function writes the batch ID 4, item (dpe) "prod_proc", action "Production process started" and the reason "Start the production process" into the audit Trail panel.

main()
{
  unsigned batchid = 4;
  string item = "prod_proc";
  string itemtype = "proc";
  string action = "Production process started";
  int error;
  string reason = "Start the production process";
  writeAuditBatchEntry(batchid,item,itemtype,action,error,reason);
  DebugN(batchid,item,itemtype,action,reason);
}

Assignment

User administration

Availability

CTRL