AdvoLogix Matter Management

Apex Invocable Methods Available Within Connector

Updated

AdvoLogix® provides a wide range of Apex invocable methods that allow you to easily execute different iManage® related actions as part of your flow or process builder, or from an Apex class.

List of Available Apex Invocable Methods

There are many different iManage® related actions that can be automated with the AdvoLogix® Connector for iManage® and Salesforce®. Here you can find the list of all available Apex methods: 

  • Create Workspace (iManageServiceCreateWorkspace)
  • Update Workspace (iManageServiceUpdateWorkspace)
  • Find Workspaces (iManageServiceLookupWorkspace)
  • Upload Document (iManageServiceUploadDocument)

Adding an Apex method to a flow is a very simple task. You just need to drag and drop or add an Action item into the Flow Builder canvas. If you filter the actions by Category and select iManage Connector, you will find all AdvoLogix® provided Apex actions available under the Action lookup field.

The detailed usage of above mentioned Apex actions is outlined below:

Create Workspace
Using the Apex Method in a Salesforce Flow

Drag and drop or add an Action item in the Flow Builder canvas. Filter the actions by Category, select the iManage Connector, and select Create Workspace under the Action lookup field.

Input Values
  • Record ID - Provide the current record's record Id value here.
  • iManage Library - Optionally, provide an iManage library name.
  • Use Asynchronous Method - Provide a true/false value to mark that this process is to be executed as an asynchronous approach.

When Use Asynchronous Method is True, then the Output Value for the iManage Workspace is returned as null.

Output Values

When the Workspace has been created successfully, this method will return an iManage Workspace apex data-type variable output. The response will contain values such as workspace id and workspace name, along with all custom profile data values and descriptions.

Salesforce does not allow Rest API executions or DML operations such as inserting or updating Salesforce records in a single transaction. In these cases, Salesforce alerts the user with the error 'You have uncommitted work pending. Please commit or rollback before calling out'. In situations where this error occurs, AdvoLogix® advises users to set Use Asynchronous Method to True.

Using the Apex Method in an Apex Class

Example Apex script:

imanage.iManageServiceCreateWorkspace.Request req1 = new imanage.iManageServiceCreateWorkspace.Request();
req1.recordId = '0010C00000WxO5fUAF';
req1.useAsynchronousMethod = false;
imanage.iManageServiceCreateWorkspace.Request[] reqList = new imanage.iManageServiceCreateWorkspace.Request{ req1 };

imanage.iManageServiceCreateWorkspace.Response[] resp = imanage.iManageServiceCreateWorkspace.process( reqList );
system.debug('Create Workspace Response :: '+resp[0]);
Update Workspace

This action method requires old and new record field values to work appropriately, and thus must be used when the flow is executing as record-triggered update event.

Using the Apex Method in a Salesforce Flow

Drag and drop or add an Action item in the Flow Builder canvas. Filter the actions by Category, Select iManage Connector and Update Workspace under the Action lookup field.

Select Objects
  • Object for "SObject Record (New)" (Input) - Select an object in which the current flow is set to be triggered from.
  • Object for "SObject Record (Old)" (Input) - Select an object in which the current flow is set to be triggered from.
Input Values
  • SObject Record (New) - Provide the record object/variable that stores the data of the record that has been changed. (Normally it will be {!$Record} variable)
  • SObject Record (Old) - Provide the Record object/variable that stores the data of the record that was saved in the database before the new changes. (Usually it should be {!$Record__Prior} variable)
  • iManage Library - Optionally, provide an iManage library name.
  • Use Asynchronous Method - Provide a true/false value to mark that this process is to be executed as an asynchronous approach.

When Use Asynchronous Method is True, then the output value for iManage Workspace is returned as null.

Output Values

When the Workspace name has been changed successfully, this method will return an iManage Workspace apex data-type variable output. The response will contain values such as workspace id and workspace name, along with all the custom profile data values and descriptions.

Salesforce does not allow Rest API executions and DML operations such as inserting, updating Salesforce records in single transaction. In these cases Salesforce alerts user with an error 'You have uncommitted work pending. Please commit or rollback before calling out'. In situations where this error occurs, AdvoLogix® advises users to set Use Asynchronous Method to True.

Using the Apex Method in an Apex Class

Example Apex script:

imanage.iManageServiceUpdateWorkspace.Request req1 = new imanage.iManageServiceUpdateWorkspace.Request();
req1.sObject_NewRecord = new Account(Id='0010C00000WxO5fUAF', Name='Test Account New Name');
req1.sObject_OldRecord = new Account(Id='0010C00000WxO5fUAF', Name='Test Account Old Name');
req1.useAsynchronousMethod = false;
imanage.iManageServiceUpdateWorkspace.Request[] reqList = new imanage.iManageServiceUpdateWorkspace.Request{ req1 };

imanage.iManageServiceUpdateWorkspace.Response[] resp = imanage.iManageServiceUpdateWorkspace.process( reqList );
system.debug('Update Workspace Response :: '+resp[0]);
Find Workspaces
Using the Apex Method in a Salesforce Flow

Drag and drop or add an Action item in the Flow Builder canvas. Filter the actions by Category and select the iManage Connector and select Find Workspace under the Action lookup field.

Input Values

Record ID - Provide the current record's record Id value here.

Output Values

On successful execution of the method, it will return the List of iManage Workspaces apex data-type variable output that has been identified as associated with the Salesforce record. Each workspace item in the response will contain values such as workspace id and workspace name, along with all custom profile data values and descriptions.

This method auto-validates whether Workspace Manager Configuration exists and is active for the object this record belongs to. If an active configuration is not found, then this method returns no workspaces associated with the record.

Using the Apex Method in an Apex Class

Example Apex script:

imanage.iManageServiceLookupWorkspace.Request req1 = new imanage.iManageServiceLookupWorkspace.Request();
req1.recordId = '0010C00000WxO5fUAF';
imanage.iManageServiceLookupWorkspace.Request[] reqList = new imanage.iManageServiceLookupWorkspace.Request{ req1 };

imanage.iManageServiceLookupWorkspace.Response[] resp = imanage.iManageServiceLookupWorkspace.process( reqList );
system.debug('All Found Workspaces For the Record :: '+resp[0].workspaces);
Upload Document
Using the Apex Method in a Salesforce Flow

Drag and drop or add an Action item in the Flow Builder canvas. Filter the actions by Category and select iManage Connector and select Upload Document under the Action lookup field.

Input Values
  • Content Version ID - Provide the Salesforce File record's record Id value here.
  • iManage Folder Name - Provide the name of the folder, which already exists within the workspace provided in the iManage Workspace input.
  • iManage Library - Provide an iManage library name.
  • iManage Workspace - Provide an iManage workspace id.
  • iManage Document ID - Optionally, provide an existing document's Id from iManage, using with this method will upload the Salesforce File to iManage as a new version of that document.
Output Values

On successful execution of this method, it will return the iManage Document apex data-type variable output. The response will contain values such as document id, document name, webview url, workspace name etc.

Using the Apex Method in an Apex Class

Example Apex script:

imanage.iManageServiceUploadDocument.Request req1 = new imanage.iManageServiceUploadDocument.Request();
req1.contentVersionId = '0690D00000WxO2fAAA';
req1.library = 'Active';
req1.workspaceId = 'Active!20213';
req1.folderName = 'Test folder';
imanage.iManageServiceUploadDocument.Request[] reqList = new imanage.iManageServiceUploadDocument.Request{ req1 };

imanage.iManageServiceUploadDocument.Response[] resp = imanage.iManageServiceUploadDocument.process( reqList );
system.debug('Uploaded Document in iManage Response :: '+resp[0].document);
Previous Article Navigation Options for Workspaces & Folders
Next Article AdvoLogix® Connector for iManage® and Salesforce® Release Notes
Still need help? Contact Us