OK a brief introduction to triggers and more importantly how I used them to overcome a formset limitation.
Triggers are events that get ‘triggered’ whenever a record in a database is updated or a new record is added to a table. From a Sage perspective it gives us control over changes made to the data and allows us control over what we do with that data.
I am currently doing a job where the only way we could deliver the required functionality was by using a database trigger. The client wanted to capture a piece of information whilst raising requisitions and have that same information available via a purchase order enquiry. The first problem was that there were no spare fields in the requisition table that could be used and using the formset editor no way of adding fields as they were all in use. What we did is to use the ‘Location Code’ field on the requisition entry screen. Now this field is actually stored in an extension table (poreqx1m) and validates the entry in this field against polocsm. The trigger was actually used to write the value from the poreqx1m table into the PO header table.


















