SmartList Builder Execute Procedure Go To Changes for GP 2010


David Meego - Click for blog homepageThis is a reposting of an article I originally wrote on my Developing for Dynamics GP blog.

If you are a Dexterity developer who uses SmartList Builder to create SmartList favorites for your products and you use the Execute Procedure Go To functionality.  This post is for you.

Below is a screenshot of the v10.0 window used for adding a Go To which executes a global procedure.  You will notice that the Procedure field is a string field into which the procedure name can be typed.

In SmartList Builder for Microsoft Dynamics GP 2010, this window has changed to use a drop down list for the Procedure field.

I would suggest that this change was made as a security measure to only allow specific procedures to be called.  But how to you get the drop down list populated with your procedures….


The information below is based on documentation provided by the SmartList Builder development team.

SmartList Builder and Navigation Builder both have goto/action types called Execute Procedure. This type can be used by third party developers to add their own gotos and actions into SmartList Builder and Navigation List Builder.

There are 3 global procedures that have been provided to allow easy integration:

  • FillRunProcedureList
  • GetRunProcedureParameterCount
  • GetRunProcedureParameterName

On each of the Execute Procedure setup windows, there is a drop down list of all procedures available to be executed from each product. This list is filled using FillRunProcedureList. When a procedure is selected, the list of parameters for the procedure is displayed. The list is determined by the GetRunProcedureParameterCount and GetRunProcedureParameterName procedures.

To integrate your Dexterity product with this functionality you will need to register triggers against these procedures.

NOTE: The scripts below use a constant called MY_PRODUCT which should contain the Product ID of your Dexterity product, if you already have this stored as a constant, modify the code accordingly. You will also need to create a SLB_PRODUCT constant with a value of 3830.

 

Startup Trigger Registration Example

{ Add to Global Procedure: Startup }

{Turn off the warning for literal strings}
pragma(disable warning LiteralStringUsed);

if not empty(Launch_GetFileName()) then
  { In Runtime Mode }
  if Launch_GetProdPosition(SLB_PRODUCT) > 1 then
    { SLB Installed }

    if Trigger_RegisterProcedureByName(SLB_PRODUCT, "FillRunProcedureList", TRIGGER_AFTER_ORIGINAL, script FillRunProcedureList_POST) <> SY_NOERR then
      error "Error registering Trigger against Smartlist Builder FillRunProcedureList Procedure.";
    end if;

    if Trigger_RegisterProcedureByName(SLB_PRODUCT, "GetRunProcedureParameterCount", TRIGGER_AFTER_ORIGINAL, script GetRunProcedureParameterCount_POST) <> SY_NOERR then
      error "Error registering Trigger against Smartlist Builder GetRunProcedureParameterCount Procedure.";
    end if;

    if Trigger_RegisterProcedureByName(SLB_PRODUCT, "GetRunProcedureParameterName", TRIGGER_AFTER_ORIGINAL, script GetRunProcedureParameterName_POST) <> SY_NOERR then
      error "Error registering Trigger against Smartlist Builder GetRunProcedureParameterName Procedure.";
    end if;

  end if;
end if;

{Turn the literal string warning back on}
pragma(enable warning LiteralStringUsed);

FillRunProcedureList Trigger Handler Example

{ Global Procedure: FillRunProcedureList_POST }

in integer ii_product_id;
inout anonymous field iof_list;

{Turn off the warning for literal strings}
pragma(disable warning LiteralStringUsed);

case ii_product_id
  in [MY_PRODUCT]
    add item "MyProcedure" to iof_list;
  else
end case;

{Turn the literal string warning back on}
pragma(enable warning LiteralStringUsed);

GetRunProcedureParameterCount Trigger Handler Example

{ Global Procedure: GetRunProcedureParameterCount_POST }

in integer ii_product_id;
in string is_procedure_name;
out integer oi_parameter_count;

{Turn off the warning for literal strings}
pragma(disable warning LiteralStringUsed);

case ii_product_id
  in [MY_PRODUCT]
    case is_procedure_name
      in ["MyProcedure"]
        oi_parameter_count = 2;
      else
    end case;
  else
end case;

{Turn the literal string warning back on}
pragma(enable warning LiteralStringUsed);

GetRunProcedureParameterName Trigger Handler Example

{ Global Procedure: GetRunProcedureParameterName_POST }

in integer ii_product_id;
in string is_procedure_name;
in integer ii_parameter_number;
out string os_parameter_name;

{Turn off the warning for literal strings}
pragma(disable warning LiteralStringUsed);

case ii_product_id
  in [MY_PRODUCT]
    case is_procedure_name
      in ["MyProcedure"]
        case ii_parameter_number
          in [1]
            os_parameter_name = "MyParameter1";
          in [2]
            os_parameter_name = "MyParameter2";
          else
        end case;
      else
    end case;
  else
end case;

{Turn the literal string warning back on}
pragma(enable warning LiteralStringUsed);

I hope you find this post useful when upgrading your code to work with GP 2010.

David

// Copyright © Microsoft Corporation.  All Rights Reserved.
// This code released under the terms of the
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

This article was originally posted on the Developing for Dynamics GP Blog and has been reposted on http://www.winthropdc.com/blog.

2 thoughts on “SmartList Builder Execute Procedure Go To Changes for GP 2010

Please post feedback or comments

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.