Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Avoid macros that crash due to pop up alerts.

Posted on by Microsoft Employee

I am new to GP as a key member of out IT team has left so I am learning the ropes.

I have discovered how to use Macros by mail merge, it's simple enough. However, is there a way to avoid, through if-statements or else, macros that crash when GP alerts something through a pop up. 

For example, I get a macro to input a large purchase order entry. However, one of my lines is below the Minimum Order Quantity and the macro crashes because I need to override this alert. 

Alternatively, if I am doing this totally wrong and there is a better method for inputting large amounts of data into entry journals, please let me know so I can investigate (some literature or youtube links would be greatly appreciated.

Thanks in advance,

-nevermerlot

*This post is locked for comments

  • Suggested answer
    Redbeard Profile Picture
    Redbeard 12,931 on at
    RE: Avoid macros that crash due to pop up alerts.

    Short of Tim's approach, you can use SmartList to divide data you wish to import into chunks for different macros. For instance, identify transactions that are going to trigger the dialogue and eliminate them from your first pass, then use the inverse selection to load the rest of the data.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Avoid macros that crash due to pop up alerts.

    OK, thanks for the help Tim.  Still not managed to get it all sorted but back working on it again now!

  • Tim Foster Profile Picture
    Tim Foster 8,515 on at
    RE: Avoid macros that crash due to pop up alerts.

    There is no way from within the Dynamics GP macro language to generate an if..then structure.

    I am using SQL code to build the macro.  MY SQL code tests the conditions the generate the modal dialog and then creates macro code to handle it.

    Tim

  • Tim Foster Profile Picture
    Tim Foster 8,515 on at
    RE: Avoid macros that crash due to pop up alerts.

    There is no way from within the Dynamics GP macro language to generate an if..then structure.

    I am using SQL code to build the macro.  MY SQL code tests the conditions the generate the modal dialog and then creates code to handle it.

    Tim

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Avoid macros that crash due to pop up alerts.

    Hi Tim,

    could you clarify how to use and If...Then structure please?  

    This is what I have at the minute which works when the pop up box appears, but doesnt work with no pop up box:

     

    ClickHit field Inactive  # 'TRUE'

    # This account has a current balance.  Are you sure you want to inactivate it?

    NewActiveWin dictionary 'default'  form DiaLog window DiaLog

     ClickHit field OK

    NewActiveWin dictionary 'default'  form 'GL_Account_Maintenance' window 'GL_Account_Maintenance'

     CommandExec dictionary 'default'  form 'GL_Account_Maintenance' command 'Save Button_w_GL_Account_Maintenance_f_GL_Account_Maintenance'

     

    How can I make it say "if the box appears, click OK, if not just save."

    Many thanks

    Paul

     

  • Suggested answer
    Tim Foster Profile Picture
    Tim Foster 8,515 on at
    RE: Avoid macros that crash due to pop up alerts.

    Instead of Word, I crafted some SQL that writes macros.  I proactively handle the Modal dialogs with if..then structures.  I did this for big, one-off (or two) things.

    For standard transactions on a repeating basis you should look at eConnect or a third party like eOne's SmartConnect or Scribe Insight.

    Tim

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans