There was recently a question in the GP Community forums where the user wanted a way to stop cash receipts for a customer on hold because of some legal requirements. MVP Leslie Vail pointed out that she had used a VBA customization to handle this. As another alternative, you can do this very easily using the Trigger feature of Support Debugging tool.
Using the Support Debugging Tool we can easily display a warning message if user selects the customer that has been put on hold while entering the Cash Receipt. This can be achieved by defining Dexterity Triggers in scripting section of the Support Debugging Tool Setup window as explained below.
There was a detailed post on using triggers earlier – Dynamics GP SDT Essential Series 3 – Using Triggers (GP on Steroids)
Note – The emphasis here is to give an example of the trigger feature in SDT, more than anything else.
For instance, here is a Customer that has been put on Hold.
While entering the Cash Receipts if a user tries to select the Customer ID for the Customer on Hold, a warning message is displayed.
The Dexterity script also disables the Amount Text field on the Cash Receipts Entry window.
The support debugging tool makes writing this code very easy.
- Generates the basic code for in and out parameters
- Generates the code for Window Open and empty fields based on events selected
- You can lookup the tables and field names using
For example – See below how the following line can be generated by just selecting the relevant field using a lookup!
Here’s the associated code for the use case defined above.
OUT_Condition = false;
if isopen(form RM_Cash_Receipts) then
if not empty(‘Customer Number’ of window RM_Cash_Receipts of form RM_Cash_Receipts) then
OUT_Condition = true;
get table RM_Customer_MSTR;
while err() <> EOF and empty(l_Hold)
if (‘Customer Number’ of window RM_Cash_Receipts of form RM_Cash_Receipts=‘Customer Number’ of table RM_Customer_MSTR) then
set l_Hold to ‘Hold’ of table RM_Customer_MSTR;
get next table RM_Customer_MSTR;
if not empty(l_Hold) then
warning “Customer is on hold”;
disable field ‘Originating Original Trx Amount’ of window ‘RM_Cash_Receipts’ of form ‘RM_Cash_Receipts’ ;
disable field ‘Original Trx Amount’ of window ‘RM_Cash_Receipts’ of form ‘RM_Cash_Receipts’;
enable field ‘Originating Original Trx Amount’ of window ‘RM_Cash_Receipts’ of form ‘RM_Cash_Receipts’ ;
enable field ‘Original Trx Amount’ of window ‘RM_Cash_Receipts’ of form ‘RM_Cash_Receipts’;
Alternatively – Just download and import the Code
You can simple download this code and test this example. The following settings file contains the code shown below. Rename the extension from txt to xml before importing. Download the settings file that contains the code here.
Select Configuration Export/Import from options menu on Support Debugging Tool window.
Options >> Configuration Export/Import
Click on the Import button to import the Script from the location specified as below.
Click OK on the Import Settings File window that contains the File ID defined for the Trigger to be imported.
Following screen shows the imported Trigger to prohibit the user from receiving cash from the Customers on Hold.
Click on the Automatic Debugger Mode link to open the Automatic Debugger Status window that contains the currently registered Triggers.