CaseCloud provides a wide range of Apex invocable methods that allow you to easily execute different HotDocs-related actions as part of your flow, process builder, or from an Apex class.
List of Available Apex Invocable Methods
There are many different HotDocs-related actions that can be automated with the HotDocs connector. Here you can find the list of all available Apex methods:
- Assemble Documents (HotDocsInterviewCreateAssembleAction)
Within the Flow Builder canvas, click on the (+) button menu and add an Action. From the Search Actions list, search for and select the relevant action to add to the canvas.
The detailed usage of the above-mentioned Apex actions is outlined below:
Input Values
- HotDocs Document Template ID -Provide the HotDocs Document Template record's Record ID value here.
- Record ID -Provide the current record's Record ID value here.
Output Values
When the document assembly is initiated successfully, this method returns an Apex data type variable. The response will contain values such as the HotDocs Interview ID, Status, and Status Message (which would contain error messages in case of errors).
Salesforce does not allow REST API calls or DML operations, such as inserting or updating 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'. When this error occurs, CaseCloud advises users to use the Scheduled Paths in the flow.
Example Apex script:
hdocs.HotDocsInterviewCreateAssembleAction.Request req1 = new hdocs.HotDocsInterviewCreateAssembleAction.Request();
req1.recordId = '0010C00000WxO5fUAF';
req1.templateId = '0a20C00000WxO5fUAF';
List<hdocs.HotDocsInterviewCreateAssembleAction.Request> reqList = new List<hdocs.HotDocsInterviewCreateAssembleAction.Request>{ req1 };
List<hdocs.HotDocsInterviewCreateAssembleAction.Response> resp = hdocs.HotDocsInterviewCreateAssembleAction.process( reqList );
system.debug('Assemble Documents Response :: '+resp[0]);
