Skip to main content

IActAutoAction

By implementing the IActAutoAction interface in a application script, you can define custom actions when creating an event on a ticket. In the newly created script, set the value of the Name property (the name of the automatic action) in the constructor of the action class.

tip

To store properties and action settings, we recommend defining the Settings class in a separate script that you create from the Class Library template.

warning

If you want to use only some of the methods of the implemented interface in the automatic action, leave an exception in the body of the other methods from the interface:

throw new NotImplementedException();

Interface methods

MethodDescription
OnActChangedEdit Event.
OnActCreatedEvent creation.
OnActRemovedDelete an event.

OnActChanged

Custom action based on event modification. In the implemented method, define both the conditions for executing the operations and the event operations themselves.

  • Syntax: void OnActChanged(SqlConnection con, SqlTransaction trans, int actId, int personId, stringproperties)
  • Parameters:
    • con - SqlConnection to the database.
    • trans - SqlTransaction of the database transaction in progress.
    • actId - The ID of the event (tAct.iActId) that was changed.
    • personId - The ID of the user (tPerson.iPersonId) who changed the event.
    • properties - the changed event fields separated by a comma ( table.column).
table.columnEvent field
tAct.dActDate of creation
tAct.liActKindIdID of Act type
tAct.sActToTo whom (receiver)
tAct.sActSubject
tAct.mActNoticeText
tDocument.liDocumentActIdAttachments
tActHd.bActHdUserReadShow ticket
tAct.bWaitingForUserWaiting for a ticket
tAct.nActWorkHoursWork
tAct.nActTravelHoursTravel time
tAct.nActTravelKmDistance
tAct.bNoChargeNoCharge
tAct.ActMarkIdAct mark (important or ticket solution)
  • Return value: none.

OnActCreated

Custom action based on event creation. In the implemented method, define both the conditions for executing the operations and the event operations themselves.

  • Syntax: void OnActCreated(SqlConnection con, SqlTransaction trans, int actId, int personId)
  • Parameters:
    • con - SqlConnection to the database.
    • trans - SqlTransaction of the ongoing database transaction.
    • actId - ID of the newly created event (tAct.iActId).
    • personId - ID of the user (tPerson.iPersonId) who created the event.
  • Return value: none.

Automatic actions can be performed in the following situations:

  • Manual creation of any event with New Event or Note.
  • Sending a message with Send Message, Reply, etc.
  • Read an email from the service mailbox using Alvao Service.
  • Manually retrieve a message from Outlook using the ALVAO for Outlook - Save to ticket log.
  • Creating a triggering event when a new ticket is created.
  • Calling the CreateAct or CreateTicket web method to create the founding message.

You can find an example usage in the SendMailsAboutNewEvent application template.

OnActRemoved

Custom action based on event removal. In the implemented method, define both the conditions for executing the operations and the event operations themselves.

  • Syntax: void OnActRemoved(SqlConnection con, SqlTransaction trans, int actId, int personId)
  • Parameters:
    • con - SqlConnection to the database.
    • trans - SqlTransaction of the ongoing database transaction.
    • actId - ID of the event being removed (tAct.iActId).
    • personId - ID of the user (tPerson.iPersonId) who deleted the event.
  • Return value: none.