Loading ...

Working with Assignment and Approval Maps in Acumatica via Automation Steps

Introduction


Assignment and Approval Maps are essential components in Acumatica, providing a framework to automate workflows, approvals, and task assignments. However, implementing them can be challenging due to Acumatica’s internal architecture, especially when working with interfaces and automation classes. In this guide, we’ll break down how to set up and use Assignment and Approval Maps, using insights from a common solution shared on Stack Overflow and practical tips.


1. Overview: Setting up Database Tables

Before implementing Assignment and Approval Maps, you need to create and modify tables for approval and entity configurations.

Database Structure

To start, define a setup table, such as XXSetupApproval, to store approval settings. This table includes fields for company, assignment map, and notification IDs:

Next, update the main entity table (XXRegister) to track approval status. Include fields for owner, workgroup, and approval status:

ALTER TABLE XXRegister ADD OwnerID uniqueidentifier NULL, WorkGroupID int NULL, Approved bit NOT NULL;

2. Defining Core Data Access Classes (DACs)

With tables set up, you’ll create classes to represent the data within the code.

Setting up XXSetupApproval DAC

This class should implement the IAssignedMap interface, which requires fields like AssignmentMapID, AssignmentNotificationID, and IsActive:

Updating Entity DAC

In the XXRegister DAC, include an email source to enable it within the Approval Map tree selector. Ensure it implements the IAssign interface to handle OwnerID and WorkgroupID fields:

3. Setting Up the Graph and Automation Steps

Implementing Automation Steps in Code

To automate approvals, use the EPApprovalAutomation helper in the graph managing your entity:

This helper streamlines assigning the Approval Map to the entity and managing the approval lifecycle.

Handling Custom Approvals

If IAssignedMap is inaccessible due to internal constraints, create a custom XXApprovalAutomation class, inheriting from EPApprovalAutomation. Override GetAssignedMaps to handle map assignments:

4. Automation Definitions and Workflow Steps

For a smooth approval flow, create automation steps that define the entity's life cycle. For example:

  1. Hold-Open - Moves the entity from "Hold" to "Open" without needing approval.
  2. Hold-Pending Approval - Triggers if the entity requires approval, moving to "Pending Approval" status.
  3. Pending Approval - Final stage where the entity can be approved or rejected.

Automation XML for transitioning between these states might look like this:

5. Configuring UI Elements for Approval

In XXSetup.aspx, add an approval configuration tab and a checkbox to enable or disable approval requirements:

6. Final Steps and Considerations

Customizing the automation steps within Acumatica is powerful, but be aware of a few limitations:

     Automation Distribution: Unfortunately, automation steps cannot be easily packaged and distributed within a customization project. These steps must often be recreated on each instance manually.

     Approval Screen Customization: For a more user-friendly approval experience, consider overriding standard fields such as Descr with meaningful values in the approval screen.

 

Conclusion

Setting up Assignment and Approval Maps in Acumatica requires a solid grasp of database structures, DACs, and graph customization. By following these steps and implementing automation thoughtfully, you can create a robust approval system that enhances workflow efficiency in Acumatica.

 

Currently rated 5.0 by 2 people

  • Currently 5.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5