Support Debugging Tool Customization #6 – Removing Voided Documents from Customer Statement
Based on a recent support request, I have decided to post yet another article which utilizes the Support Debugging Tool to achieve the above requirement, where in the voided documents do not appear in the Customer Statement.
For this requirement, I have customized the RM Statement On Blank Paper version of the Customer Statement. The other versions can also be modified accordingly.
Version Information
Dynamics GP : 11.0.1752 (SP2)
Support Debugging Tool : 11.00.0015
Screenshots of the Configuration
Create a Runtime Execute script block with the code given below with the script ID as STMTVOIDEXCL.
local string MBS_TableLineString; local string MBS_Number; local integer MBS_Type; local currency MBS_SequenceOne; local currency MBS_SequenceTwo; local integer MBS_Control; local string MBS_String; call with name "MBS_Param_Get" in dictionary 5261, "Number", MBS_Number; call with name "MBS_Param_Get" in dictionary 5261, "Type", MBS_String; MBS_Type = integer(value(MBS_String)); call with name "MBS_Param_Get" in dictionary 5261, "SequenceOne", MBS_String; MBS_SequenceOne = currency(value(MBS_String)); call with name "MBS_Param_Get" in dictionary 5261, "SequenceTwo", MBS_String; MBS_SequenceTwo = currency(value(MBS_String)); call with name "MBS_Param_Get" in dictionary 5261, "Control", MBS_String; MBS_Control = integer(value(MBS_String)); MBS_TableLineString = ""; { Add your code below here } release table RM_OPEN; clear table RM_OPEN; set 'RM Document Type-All' of table RM_OPEN to MBS_Type; set 'Document Number' of table RM_OPEN to MBS_Number; get table RM_OPEN by number 4; if err() = OKAY then if 'Void Status' of table RM_OPEN = 1 then set MBS_TableLineString to ""; else set MBS_TableLineString to "V"; end if; else set MBS_TableLineString to "V"; end if; { Add your code above here } call with name "MBS_Param_Set" in dictionary 5261, "TableLineString", MBS_TableLineString; |
Then modify the RM Statement On Blank Paper report and create a calculated field, as explained below, which calls the custom Report Writer function for which we have created the script block above.
Calculated Field Name : Valid
Result Type : String
Expression Type : Calculated
The formula for this calculated field is as shown below.
FUNCTION_SCRIPT( rw_TableLineString 5261 “STMTVOIDEXCL” RM_Statements_TRX_TEMP.Document Number RM_Statements_TRX_TEMP.RM Document Type-All 0.00000 0.00000 1 )
Now, place the field on the body section of the report layout and make the field invisible.
And then go to the Section Properties and define the following setting for the body section, to hide the body conditions whenever the calculated field Valid is empty. Our custom runtime script which we have written in Support Debugging Tool will set this field value to V if it’s a valid record and will make this field blank when it is a voided record, thus hiding the voided records from the report.
Configuration File Download
You can download the configuration xml file here.
Reference
Take a look at the article below which summarizes the usage of Support Debugging Tool with some real life examples. Great compilation by David! http://blogs.msdn.com/b/developingfordynamicsgp/archive/2011/08/05/using-the-support-debugging-tool-with-real-life-examples.aspx
Hope this helps the community…
Until next post!
Category: Accounts Receivables, Customizations, Dynamics, Great Plains, Support Debugging Tool




Pingback: Everything Dynamics GP #22 - About Dynamics, Development and Life - GP Technical Blogs - Microsoft Dynamics Community
Pingback: Support Debugging Tool Customization #6 – Removing Voided Documents from Customer Statement | Interesting Findings & Knowledge Sharing - DynamicAccounting.net - GP Technical Blogs - Microsoft Dynamics Community