Creating an Activity Plan Via Process Builder

The following technique has been developed to provide organizations with the ability to instantiate a new Activity Plan from within the Process Builder.

Use the following custom Apex Class to facilitate using the Process Builder to create new Activity Plans for Matters, Accounts and Contacts.

AdvoLogix Activity Plan Apex Class

Apex Class Name:
apProcessBuilder 

Parameters:
@Action Plan Template ID
The record ID of the Activity Plan Template to be used for the new Activity Plan. 

@Source Record ID
The record ID field of the source object the new Activity Plan is being created for. This will be either the Matter, Account or Contact record ID field.  


Creating an Apex Action Type in Process Builder:
To use this class in Process Builder, follow these steps as highlighted below:

  1. Go to Setup | Create | Workflows & Approvals | Process Builder, and Create a New Process and click Add Action.

  2. Select Action Type as Apex.

  3. Enter Action Name. This is your way of identifying the action in the list of actions.

  4. Select apProcessBuilder as Apex Class. Two parameters are automatically added to Set Apex Variables section.

  5. Enter the record ID of the Activity Plan Template you wish to instantiate with this Action.

  6. Select Reference as the Field Type for the Source Record ID.

  7. Use the field selector to choose the field named Record ID. This will select the Matter, Account or Contact record ID field. Note you may quickly filter the field selection list by typing "record id".

  8. Click Save.