Report Abuse

1 Reply

While assistance with SQL and custom fields/triggers is outside the scope of support, I can let you know that you cannot get what you are trying to do with the trigger being on the invoice table as it is written before the invoice items. Try using the ar table when the record inserted is for an invoice (i.e., TransType = 1).

Report Abuse

Although I was wondering is there a possibility to have a variable based user defined view. In that case i can simply write Views and then call them from Trigger. The SQL will look more clean and neat.Hassan ShifazMarch 7, 2016 at 6:57 AM

While the view must be straight SQL, this does not stop you from your approach as the view can be your sub-query and include the customer number and invoice number so that your trigger selects the net value based on these two values.Mark CulosMarch 7, 2016 at 3:24 PM