Microsoft Dynamics GP Developing for Dynamics GP
A blog dedicated to the Microsoft Dynamics GP Developer & Consultant community
 
Welcome to MSDN Blogs Sign in | Join | Help

Developing for Dynamics GP

by David Musgrave (Australia) and the Microsoft Dynamics GP Developer Support Team (USA)

News

  • Please use the Blog Feedback? - Contact Us link at the top of the page to email questions relating to the blog itself.

    If you wish to ask a technical question, please use the links below to ask on the Newsgroups. If you ask on the Newsgroups, others in the community can respond and the answers are available for everyone in the future.

    Please do not use comments on pages and posts to ask questions unrelated to the topic on that page or post.



    Dates of Interest:

    11-Jul-2008: Blog Created by David Musgrave.
    10-Oct-2008: First Post by Scott Stephenson.
    04-Nov-2008: First Post by Dave Dusek.
    11-Nov-2008: First Post by Beth Gardner.
    28-Nov-2008: First Post by Chris Roehrich.
    30-Dec-2008: First Post by Patrick Roth.
    24-Feb-2009: First Post by Greg Willson.
    22-Apr-2009: First Post by David Clauson.
    04-May-2009: First Post by Ryan Wigestrand.
    19-Jun-2009: First Post by Dawn Langlie.
    03-Jul-2009: First Post by Emily Halvorson.
    23-Sep-2009: Created Twitter account with blog feed.
    20-Nov-2009: First Post by Alice Newsam.



    WorldMaps Statistics since
    24-Feb-2009:




    Click for WorldMaps Stumbler



    Translator Tool:




    Social Networking

    Follow David Musgrave and the blog on:

    David Musgrave on Twitter

    David Musgrave on LinkedIn


    Disclaimer

    This blog is provided "AS IS" with no warranties, and confers no rights.

    The links in this blog may lead to third-party Web sites. Microsoft provides third-party resources to help you find customer service and/or technical support resources. Information at these sites may change without notice. Microsoft is not responsible for the content at any third-party Web sites and does not guarantee the accuracy of third-party information.

Contents

Favourite Posts

Blog Links

Newsgroups Links

Resources Links

Using the Dexterity Three Trigger Technique Part 1

David MeegoWhen working with Dexterity triggers, the hardest part of the process is working out where to place the triggers. There are times where it seems impossible to get the trigger you need in the correct location. This post explains the concept of what I call the Three Trigger Technique. The technique involves using a trigger on an apparently unrelated function or procedure which executes at the appropriate point within the code of the function or procedure. Let me explain in more detail ...

The Theory

I have a function or procedure (Script A) which runs a series of commands. I need to trigger after the first half of the commands in Script A, but before the end of Script A.  Using Source Code or Script Logging I can identify other functions and procedures which are called by Script A.  I find a function or procedure (Script B) which runs around the location I would like my trigger to be placed.  I can now register my trigger before or after the original code of Script B. This gives me the correct timing for the trigger.

However, this unrelated Script B could be called from other locations.  So I need to ensure that my trigger is only executed when Script B is called from inside Script A.  To achieve this I use a global system variable which is set and cleared by triggers before and after Script A respectively.  The code in my trigger against Script B then checks this global system variable before continuing.

The final point is that I might need access to variables or table buffers that are not parameters to Script B, so I can either use my before Script A trigger or other additional triggers to capture the values or references to the parameters I need.

The Problem

I don't want to focus on the problem as this post is all about the techniques used, but a real life example is the best method to show how this method works.

I was working on a support case recently where the customer was using the Copier Series to duplicate a Purchase order with Non-Inventory items using a Unit of Measure other than "Each".  There had been a previous issue with Blanket POs in version 10.0 and the code had been altered to not copy the Unit of Measure for Non-Inventory items.  This was causing the customer pain as they wanted to use other Units of Measures with their Non-Inventory items and did not use Blanket POs.

I provided the partner with source code for a trigger based "fix" for this issue.  Their developers then used this to provide the customer with a work around fix until the actual code can be changed.

The Solution

The solution to this problem required Cross Dictionary code as well as the use of the Three Trigger Technique and will be covered in the next part of this post, which will be available on the 30-Mar-2009.

David

Posted: Friday, March 27, 2009 9:00 AM by David Musgrave

Comments

Developing for Dynamics GP said:

In the previous part of this post we discussed the theory of the Three Trigger Technique and the details

# March 30, 2009 3:55 AM

David Musgrave said:

# March 30, 2009 10:23 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker