Time to get into some Dexterity code. I saw a posting today on the Microsoft Dynamics GP community forum. It was asking about the disappearance of the Void Button from the SOP_Entry form and how to work with the new Action Button.
In v9.0 and earlier versions of Microsoft Dynamics GP, each action had its own button. Other than Save, we had Delete, Void, Post, Transfer, Purchase, Confirm and Copy. These buttons would be enabled and disabled as appropriate depending on the document type and various business rules.
In v10.0 we wanted to add more actions for new features but there was no more room on the window for additional buttons. The solution was to move all the actions to an Actions Button which could be populated with the valid actions for the current document. So all the actions other than Save and the new workflow Submit for Approval button were moved to the Action Button.
If you wanted to trigger before the Void action, in v9.0 it was a simple focus trigger before the Void Button. So how do you handle this for v10.0. Below are the code examples to show the easiest way to handle this change.
v9.0 code for Startup procedure and Void Button trigger handling script:
{ Startup Procedure }local integer l_result;
l_result = Trigger_RegisterFocus(anonymous('Void Button NONE' of window SOP_Entry of form SOP_Entry), TRIGGER_FOCUS_CHANGE, TRIGGER_BEFORE_ORIGINAL, script MBS_SOP_Entry_Void_PRE);if l_result <> SY_NOERR then warning "SOP Entry Void PRE Trigger registration failed.";end if;
v10.0 code for Startup procedure and Action Button trigger handling script:
{ Startup procedure }local integer l_result;
l_result = Trigger_RegisterFocus(anonymous('Action Button' of window SOP_Entry of form SOP_Entry), TRIGGER_FOCUS_CHANGE, TRIGGER_BEFORE_ORIGINAL, script MBS_SOP_Entry_Action_PRE);if l_result <> SY_NOERR then warning "SOP Entry Action PRE Trigger registration failed.";end if;
Please forgive the literal (hard coded) string, but this is just to show the concept and I know that you will all use a getmsg() when you use this in your real code. For more information on handling literal strings look at the Best Practices section of the Dexterity Articles & Links page.
If you want to work with the Action Button from Visual Basic for Applications (VBA), have a look at the following post from Mariano Gomez on the topic:
Upgrading SOP Entry VBA Customizations from Dynamics GP 9.0 to Dynamics GP 10.0
Hope this is helpful.
David
Ref: Content Idea 100401
Posting from the Dynamics GP Blogster
http://dynamicsgpblogster.blogspot.com/2008/10/developing-for-dynamics-gp-weekly.html
Michael Johnson (the MBS Guru ) has posted a great article about removing invalid references from a Visual
PLEASE READ BEFORE POSTING
Please only post comments relating to the topic of this page.
If you wish to ask a technical question, please use the links in the links section (scroll down, on right hand side) to ask on the Newsgroups or Forums. If you ask on the Newsgroups or Forums, others in the community can respond and the answers are available for everyone in the future.