Sterio, Louis Posted January 12 Share Posted January 12 (edited) Submitter: Anonymous Business Need: Below is an example of how to use formulas in a Platform document template/trigger to sum up a field in Purchasing line items and place the total in a custom field on the header of the purchasing document. Pre-Requisite: Ensure that Platform Services are enabled for your account. Tool Limitations: Run in offline mode only FAQ's: None Installation Steps: Navigate to Platform Services->Objects. Search and select the object for your purchasing transaction definition making sure that the integration name is PODOCUMENT. Navigate to the Platform document templates section and create a new template. Give it any name and any template type. For the template body, use the below and save the template: <update_potransaction key="{!PODOCUMENT.DOCID!}"> <customfields> <customfield> <customfieldname>TOTAL_QTY</customfieldname> <customfieldvalue>#EVAL[ var total = 0; {!#LOOP_BEGIN.all#PODOCUMENTENTRY@DOCHDRID@[email protected]!} total += {!PODOCUMENTENTRY.QUANTITY!} {!#LOOP_END.all!} return total; ]</customfieldvalue> </customfield> </customfields> </update_potransaction> Navigate to the trigger section and create a new trigger of type ‘Intacct API‘. Make sure the trigger is deployed. Select the trigger activations needed. (Minimum should be ‘After create’) Give the trigger a name. Check the ‘Run offline’ checkbox. For the Document template, choose the template created in step 4. Save the trigger. Fields: TOTAL_QTY custom field on header level of purchasing transaction in scope Usage Steps: Create purchasing transaction with multiple line items and quantities Edited January 12 by Sterio, Louis Link to comment Share on other sites More sharing options...
Recommended Posts