Support Debugging Tool Customization #6 – Removing Voided Documents from Customer Statement

| 08/18/2011 | 2 Comments

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.

image

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

image

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.

image

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.

image

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!

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Tags: , , ,

Category: Accounts Receivables, Customizations, Dynamics, Great Plains, Support Debugging Tool

About the Author ()