How to modify the Safepay Transactions upload window to allow macros to run

Dave DusekThe following is a situation that I have come across a couple of different times.  What people want to do is set up a macro to run at night to generate their Safepay EFT file.  They want to just set it up to run every night whether there are transactions to process or not.  The problem comes in when there are no transactions to process. 

  1. The user would record a macro to log into GP (see KB 855677 Secure Link) and go to the Safepay Transactions Upload window.  

  2. In the window, the macro would select the Bank ID and then click Load/Reload Transactions button to fill the window.  

  3. Then the macro would click the Upload button to generate the EFT file.  When there are transactions to upload, you receive a message that asks if you would like to upload transactions.  The macro would click proceed and after the file is generated, you receive a warning statement that the file has been generated. 

  4. The macro would then click ok.  Another warning messge comes up that tells you to get a confirmation number.  The macro would click ok there and then put in the confirmation number. 

You get the idea here, the macro recorded deals with multiple warning dialogs on a successful upload,  In the case where there are no transactions to upload, when the Upload button is clicked, you get a warning that there are no transactions to process and the upload aborts. 

As you can see one macro won't work in both of the above scenarios.  If there are no transactions to upload, the macro crashes and then will just sit logged into GP.  So that's the situation we are trying to avoid. 

When the Upload button script runs, it checks the '(L) Number of Checks' local field on the window ME_PP_Transactions of form ME_PP_Transactions and if that is zero, then it gives the warning that there are no transactions to upload.  So what we can do to trick the system is put a focus trigger on the Upload button and if the field '(L) Number of Checks'  is zero, just simply set it to 1.  When you do that, all the windows come up as normally when there are transactions to process.  The only difference is that you just get an empty text file.  What this allows us to do now is have one macro log in and run at night and always work whether there are transactions to upload or not. 

Here is the Dexterity code that I used to accomplish this and a partner also used VSTools to get the same result.  VBA doesn't work because the '(L) Number of Checks'  field is disabled on the window, unless you wanted to use the unsupported method of running sanScript from VBA.     

Example Dexterity Code - This is the trigger processing procedure on a cross dictionary focus trigger on the Upload button in Safepay.  This trigger runs before original. 

Hope you find this useful. 

Dave Dusek
Dynamics GP Developer Support

// Copyright © Microsoft Corporation.  All Rights Reserved.
// This code released under the terms of the
// Microsoft Public License (MS-PL,

Comments (4)

  1. Dave Dusek has a new article up on Developing for Dynamics GP where he explains how to modify the Safepay

  2. Sue Coady says:

    How do you setup the security to run a macro?  I get an error that the user doesn’t have the rights to run a macro.  I can’t seem to find where that security would be set.

  3. David Musgrave says:

    Hi Sue

    There is no actual security setting on macros in Dynamics GP.  This sounds more like a file permission issue at the operating system level.

    What is the exact wording of the message and when does it occur?


  4. Adam says:


    I realize this blog from you is from a few years ago. However, I am just now attempting to add this script in order to automate our Safe Pay upload. I've installed Dexterity 11.0, copied the SFPAY.DIC to Dexterity, and added the script that you've provided. Now, how do you recommend that I test it, and then move it to our production environment?

    Thank you sir,


Skip to main content