Overview

Overview of Macros

Macros are business rules that are stored in the APM Rules Library and can be invoked outside of standard record functions via URLs to support workflows and invoke actions independently of creating, updating, or deleting records.

A macro is any public static method defined in a Rules Library project and can perform any function you like. After you have created a macro, you will need to construct a URL to invoke it from the desired location (e.g., Home Page, query results, link on the Associated Pages menu).

Macros are rules that can be invoked outside of standard record functions via URLs to support workflows and invoke actions independently of creating, updating, or deleting records.

Macros are stored in the Rules Library. To create a macro, you create a Rules Library project and then write the rules that you want the macro to execute. After the macro exists, it can be invoked via a APM URL. Where you put the URL in the APM Framework application (e.g., on a Home Page or in Query results) will depend upon the workflow within which you want to execute logic defined in the macro.

A macro can be any static public method and can perform any function you like. Macros are most useful for facilitating workflows or for invoking custom functionality from the Home Page, Query Results, or a link on the Associated Pages menu. For example, you might want to develop a macro that displays a dialog box that prompts a user to make a choice and then performs an action based upon the choice that is made. Macros add extensibility and flexibility to the APM baseline features.

Note: Because a macro can be any static public method defined in a Rules Library project, a macro can also be called from a family-level or field-level business rule by referencing the project and then calling the method. The main benefit of macros, however, is that they can be called outside of family-level and field-level rules to facilitate any workflow at the point-of-access that you choose and are not limited to being invoked by standard record functions.

The URL for calling a macro:

!webmacros/macrorunner?project=public\rules library\client\macrobaseline\test&macro=macrotest&EntityKey=[enty_key]

TextDescribes
testPublic class name in the rule
macrotestFunction name
EntityKey[enty_key] specifying the parameters passed

Create a Macro

Procedure

  1. APM Rules Editor.
  2. Select Library.

    The Rules Library appears.

  3. Add a Folder to the Rules Library.
  4. Create a Rules Library Rule Project.
  5. Within the project, create a class, and define a public static method.
  6. Within the method, write the desired code to define the functionality of the macro.
  7. Compile the Rules for a Specific Rules Library Project.
  8. Construct a URL to invoke the macro from the desired location. For example, you might want to:
    • Add a URL to a Home Page.
    • Add a URL to query results.
    • Create a link on an Associated Pages menu.