Developing for Dynamics GP

by David Musgrave (Perth, Australia) and Microsoft Dynamics GP Developer Support Team (Fargo, ND, USA)

Hybrid - Purchasing Terms & Conditions Example

Hybrid - Purchasing Terms & Conditions Example

  • Comments 3

This example shows how you can call a Dexterity report from Visual Basic for Applications (VBA).  The report can be either a built in report or a custom report.  If a built in report is used security will define whether the original, modified, alternate or modified alternate version will be printed.

This specific example will print a Purchasing Terms & Conditions report for each Purchase Order printed via the "POP Purchase Order Blank Form" report.  The VBA code counts how many times the Report Header section is printed.  It then uses the Continuum Integration Library to execute pass through Dexterity sanScript.

The Dexterity code uses the POP_PrintDocList_TEMP table as a dummy temp table to create one record for each copy of the Purchase Order Terms and Conditions needed. It then runs the custom report "Purchasing Terms and Conditions" which will print one page for each record in the table.  The code also handles the Named Printers selection if Named Printers is being used.  This approach allows a single multiple page report to be printed, rather than multiple single page reports.

One final hint: If you are having trouble getting the actual wording for the Terms and Conditions to display/print nicely due to having to use multiple static text fields for each line, try the solution mentioned in my posting, How to get large amounts of text to look good on a report.

NOTE: This customisation uses a method of executing Dexterity sanScript code from VBA which is unsupported by Microsoft.

Example code for v8.0, v9.0 & v10.0 is attached at the bottom of the article.

Please see the "Installation Instructions.txt" file in each version's archive for more information.

Attachment: Purchasing Terms & Conditions
Page 1 of 1 (3 items)
Comments Information


Please only post comments relating to the topic of this page.

If you wish to ask a technical question, please use the links in the links section (scroll down, on right hand side) to ask on the Newsgroups or Forums. If you ask on the Newsgroups or Forums, others in the community can respond and the answers are available for everyone in the future.

Leave a Comment
  • Please add 5 and 2 and type the answer here:
  • Post