|Sales Transfer Documents window|
While this "fix" has been provided as a Modifier with VBA project before, I thought, why not really prop this up a bit with a Support Debugging Tool non-logging trigger and take advantage of the Automatic Debugger Mode functionality? Well, I have done just that!
The first thing we need to do is setup the trigger itself. In this case, we want to select a Focus Event trigger that will fire exactly on a field change condition. The field in question is the '(L) Order To Invoice CB' checkbox field. You can use the lookup button next to the Form Name field on the Resource tab to open the Support Debugging Tool's Resource Explorer window and locate the field and select it.
Second, we can choose to have the Support Debugging Tool perform certain actions when the event fires - the event being when the checkbox is marked. If you happen to be running build 15 of the SDT, you can have a message display as a desktop alert on the lower right corner of your screen, similar to when you receive a Microsoft Outlook message.
For the purpose of this trigger, we will not take any actions when the trigger fires.
Third, we must add the processing script. The Support Debugging Tool does a really good job at providing a helper to build upon. So all we need to do is add the little bit to process the Include Totals and Deposits checkbox field, after the Transfer to Invoice checkbox has been marked. This is the final script:
|Trigger processing script|
Finally, since this is a non-logging trigger, the Options tab will show all logging options disabled. However, you can still choose a date range for this trigger to take effect.
We can choose to turn on our Non Logging Automatic Start Only triggers. Since our SOP_XFER trigger has been marked as a non-logging automatic trigger we should be able to see it in the Automatic Debugger Mode Status window.
|Automatic Debugger Mode Status window|
This is really all there is to it! The trigger should now cause the Include Totals and Deposits checkbox to activate automatically when we choose the Orders to Invoices checkbox.
I have attached the configuration file to be imported with the Support Debugging Tool's Configuration Export/Import window. Once you import the XML file just activate your trigger as indicated above and you should be good to go. No more forgetting to mark Include Totals and Deposits when transferring orders to invoices.
Include Totals and Deposits trigger - SOP_XFER.zip
The Support Debugging Tool's non-logging triggers functionality is a very powerful way to deploy simple scripts that can take care of every day headaches. All you need is a bit of creativity and the tool itself - see David Musgrave's article Support Debugging Tool Build 15 released for more on the latest Support Debugging Tool build.
Until next post!
Mariano Gomez, MVP