AdvoLogix Matter Management

Creating an Activity Plan Via Code


The following Apex method can be used create an Activity Plan via custom coding. Please be aware this method uses asynchronous processing techniques that require knowledge of best practices as they relate to asynchronous processing. It is always suggested to test your code in the Sandbox.

The name of the newly created Activity Plan.

The record ID of the Activity Plan Template to be used for the new Activity Plan.

The record ID of the source object the new Activity Plan is being created for. This will be either a Matter, Account or Contact ID as specified in the next parameter.

The API name of the base object for the ID specified in the record ID.
Options are 'advpm__Matter__c' for Matter, 'Account' for Account and 'Contact' for Contact.

The function call will return a JSON formatted string in this format: {success:"",result:""} 

Will be either TRUE or FALSE

Confirmation message of process completion OR Error message if process is hauled with any unexpected error.  

    'My New ActionPlan',  

Multiple recordId parameters can be passed to create a multiple new Activity Plans for several Matter objects with a single function call. Use a ',' (comma) to separate the ID values. e.g: 'a05900000051CpN,a05900000052CpN,a05900000053CpN'  

Example Using a Button from the Matter Context 

Previous Article How do Activity Plan dependencies work?
Next Article Deleting an Activity Plan Via Code
Still need help? Contact Us