OSTENDO
Reference Guide

User Defined Actions


File: > Customisation Configuration -> User Defined Actions

The concept here is that you can define an Insert Action to be triggered after a condition is met. Typical examples of this could be when the condition is met:

The Action is defined as an Insert SQL Statement along with the Conditional Clause which triggers the Action.

eg: JobHeader.SalesPerson (aliases may be used to abbreviate table names 'OTHER'  than Primary Table Name)

eg: (coalesce(CUSTOMERMASTER.CUSTOMEREMAIL, '')  = '')(The coalesce guards against the possibility of a 'blank' existing in the email field)

EXECUTE PROCEDURE PROCEDURENAME [CUSTOMERMASTER.CUSTOMER],[CUSTOMERMASTER.CREDITTERMS],'ABC'

Suppose we have a custom table that records instances of items where the Quantity on Hand was less than Zero at the point the Item Master was Updated. When that condition is met, the Action rule will insert a record into the Custom Table.

Table Name

Action When

From Clause

Conditional Clause

Insert  Statement

Rule Status

Restricted User

ITEMMASTER

On Update Only

ITEMMASTER

ITEMMASTER.ONHANDQTY < 0

INSERT INTO OSTDEF_NEGQTYS (ITEMCODE,ONHANDQTY) VALUES ([ITEMMASTER.ITEMCODE], [ITEMMASTER.ONHANDQTY])

Active For All Users


Suppose we wish to create a new Call Ticket when a new Customer is created. Note: In this example there is no Conditional Clause as we want this to occur for every new customer that is created.

Table Name

Action When

From Clause

Conditional Clause

Insert Statement

Rule Status

Restricted User

CUSTOMERMASTER

On Insert Only

CUSTOMERMASTER


INSERT INTO CALLNOTES (CALLMETHOD,CALLDATE,CALLTIME,CALLSTATUS,COMPANYTYPE,COMPANYNAME,CALLBRIEFDESCRIPTION) VALUES ('Phone','now','now','Open','Customer',[CUSTOMERMASTER.CUSTOMER],'Send out Information Pack')

Active For All Users