Using the Support Debugging Tool to assist with Report issues

David MeegoA new feature to the Support Debugging Tool for Microsoft Dynamics GP build 11 is the support for the rw_ReportStart, rw_ReportEnd, rw_TableHeaderString, rw_TableHeaderCurrency, rw_TableLineString, and rw_TableLineCurrency report writer user defined functions.

The Knowledge Base (KB) article below explains how a third party developer can add triggers to the place holder RW functions in the core Dynamics.dic.  Then when they are used as User Defined functions from a calculated field in Report Writer, the developer can read the parameters passed in and return the desired data from their data.  This allows simple integration of data from a third party dictionary back into a modified report from any product.

Useful functions for developers to use instead of creating alternate reports in Microsoft Dynamics GP (KB 888884)  Secure Link

The first two parameters for all 6 of the report writer functions is a Product or Dictionary ID and a Report Name.  If you set the Dictionary ID to 5261 which is the Support Debugging Tool's ID and the Report Name to the name of a Script ID from the Runtime Execute window, you can run scripts to capture data from calculated, legends, report, or table fields and log them using the MBS_Auto_Log Helper function.

Parameters are passed to and from the Runtime Execute script using the MBS_Param_Get and MBS_Param_Set Helper functions.  The Helper Function Assistant window can create template scripts for each of the functions to handle all the parameter passing. For more information see the Support Debugging Tool User Guide manual.

Below are the parameter lists for the functions and examples of how they would be called from a Report Writer calculated field.

rw_ReportStart

Result  String
Parameters in integer dict_id; {Dictionary ID} in string script_id; {Script ID}
Example FUNCTION_SCRIPT(  rw_ReportStart  5261  "Script ID"  )

rw_ReportEnd

Result  String
Parameters in integer dict_id; {Dictionary ID} in string script_id; {Script ID}
Example FUNCTION_SCRIPT(  rw_ReportEnd  5261  "Script ID"  )

rw_TableHeaderString

Result  String
Parameters in integer dict_id; {Dictionary ID}in string script_id; {Script ID} in string sNumber; {control field 1}in integer sType; {control field 2}in integer iControl; {which piece of data to return}
Example FUNCTION_SCRIPT(  rw_TableHeaderString  5261  "Script ID"  SOP_HDR_WORK.SOP Number  SOP_HDR_WORK.SOP Type  1  )

rw_TableHeaderCurrency

Result  Currency 
Parameters in integer dict_id; {Dictionary ID}in string script_id; {Script ID} in string sNumber; {control field 1}in integer sType; {control field 2}in integer iControl; {which piece of data to return} 
Example FUNCTION_SCRIPT(  rw_TableHeaderCurrency  5261  "Script ID"  SOP_HDR_WORK.SOP Number  SOP_HDR_WORK.SOP Type  1  )

To use the rw_TableLineString and rw_TableLineCurrency report writer functions we need to be able to pass the two sequence fields as currency data type.  So to use the Sales Order Processing Fields SOP_LINE_WORK.Line Item Sequence and SOP_LINE_WORK.Component Sequence, we will need to create two calculated fields to convert them from a long integer to a currency data type.

Calculated Field (C) Line Item Sequence is defined as result type currency with the expression of SOP_LINE_WORK.Line Item Sequence * 1.00000.

Calculated Field (C) Component Sequence is defined as result type currency with the expression of SOP_LINE_WORK.Component Sequence * 1.00000.

rw_TableLineString

Result  String
Parameters in integer dict_id; {Dictionary ID}in string script_id; {Script ID} in string sNumber; {control field 1}in integer sType; {control field 2}in currency cSequenceOne; {control field 3}in currency cSequenceTwo; {control field 4} in integer iControl; {which piece of data to return} 
Example FUNCTION_SCRIPT(  rw_TableLineString  5261  "Script ID"  SOP_LINE_WORK.SOP Number  SOP_LINE_WORK.SOP Type  (C) Line Item Sequence  (C) Component Sequence  1  )

rw_TableLineCurrency

Result  Currency 
Parameters in integer dict_id; {Dictionary ID}in string script_id; {Script ID} in string sNumber; {control field 1}in integer sType; {control field 2}in currency cSequenceOne; {control field 3}in currency cSequenceTwo; {control field 4} in integer iControl; {which piece of data to return} 
Example FUNCTION_SCRIPT(  rw_TableLineCurrency  5261  "Script ID"  SOP_LINE_WORK.SOP Number  SOP_LINE_WORK.SOP Type  (C) Line Item Sequence  (C) Component Sequence  1  )

For more information on the Support Debugging Tool, please look at the articles below:

For some examples of these Report Writer functions in use, please see the articles below:

For other related articles and posts have a look at the Support Debugging Tool Tag page.

David

09-Jul-2012: Added links to example blog articles.