Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

How to Write in GP Macro IF

Posted on by 55

Im running a macro should fulfill a transfer entry by its self 

but the problem happens when im short with this Qty im that warehouse 

so i wanna tell the macro if it come up the dialog box not enough Qty press ok 

So how do i write if That happen press ok??

*This post is locked for comments

  • Tim Foster Profile Picture
    Tim Foster 8,515 on at
    RE: How to Write in GP Macro IF

    Mariano,

    My SQL macro generation responds to modal dialog boxes after I determine the conditions that cause them to show up.

    And I see Ian explains it quite nicely in his later post.

    Tim

  • Mariano Gomez Profile Picture
    Mariano Gomez 26,225 on at
    RE: How to Write in GP Macro IF

    My point precisely. If there are unexpected dialogs outside of the final macro outcome with either your SQL script or your Excel formula generator, or there are buttons that need to be pressed differently, based on the dialog that is presented, then your generated macros will fail.

  • ICH BIN ICH Profile Picture
    ICH BIN ICH 55 on at
    RE: How to Write in GP Macro IF

    meanwhile i don't understand and i will be out of the office from now till Monday so no time to figure it out  

    On Monday i will try to figure it

    Thanks every 1 for the help

    and if any 1 can help me out more clear i will appreciate

    Thanks again and have a wonderful weekend

  • Ian Grieve Profile Picture
    Ian Grieve 22,782 on at
    RE: How to Write in GP Macro IF

    You can do similar with an Excel formula.

  • ICH BIN ICH Profile Picture
    ICH BIN ICH 55 on at
    RE: How to Write in GP Macro IF

    Thanks all beautiful ppl for trying to help me

    But i don't know a SQL is working anyway so i will not use it until i will learn my self

    (I dont want to mass up)

  • Ian Grieve Profile Picture
    Ian Grieve 22,782 on at
    RE: How to Write in GP Macro IF

    You can handle if statements in the SQL to generate a different macro for each item, but you <strong>need to know exactly what will happen at each step</strong> and code the different cases into the SQL which outputs the macro.

    This example for logging into each GP company one after the other (http://azrcrv.co.uk/5X0wAn) handles the sample company as well as test and historic companies by having a case statement handle the conditions and output a slightly different macro for each scenario.

    So this is not a case of the macro handling the if statement (because they cannot), but being handled in the SQL statement which generates the macro (you can do similar in the Excel formula example) by accounting for the differences which will occur when the macro is run.

  • Mariano Gomez Profile Picture
    Mariano Gomez 26,225 on at
    RE: How to Write in GP Macro IF

    Tim,

    The SQL macro generator provided by Ian Grieve does not handle IF scenarios. Macros do not handle if scenarios and cannot react conditionally to modal dialogs, simply because you won't know what is going to appear on the screen. 

  • Tim Foster Profile Picture
    Tim Foster 8,515 on at
    RE: How to Write in GP Macro IF

    I wouldn't send it if it wasn't helpful to your problem.

    The SQL macro generation route can handle the IF scenario you are trying to address.

    I've done it myself on several occasions.

    Tim

  • ICH BIN ICH Profile Picture
    ICH BIN ICH 55 on at
    RE: How to Write in GP Macro IF

    [quote user="Tim Foster "]

    Rather than giving up...

    You could learn more about macros in Dynamics GP.

    What you are trying to do in a macro can be accomplished.

    Have a look at http://www.azurecurve.co.uk/2017/11/microsoft-dynamics-gp-macros-series-index/

    Tim

    [/quote]

     

    I didn't give up on this macro 

    because the macro is working fine just sometimes when the Qty is short (What should not happen)

    The Macro stops but if everything is good (what usually it is) everything is working fine

    on this link what you send me i will found something about IF?

  • Suggested answer
    Tim Foster Profile Picture
    Tim Foster 8,515 on at
    RE: How to Write in GP Macro IF

    Rather than giving up...

    You could learn more about macros in Dynamics GP.

    What you are trying to do in a macro can be accomplished.

    Have a look at http://www.azurecurve.co.uk/2017/11/microsoft-dynamics-gp-macros-series-index/

    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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans