Step 3 - Create Apex Classes

Create two custom Apex classes to enable the Document AI flow functionality.

  1. Go to the Setup Menu.
  2. From the dropdown menu, select Developer Console.
  3. In the Developer Console, click File > New > Apex Class.
  4. Enter the class name: de_DataCloudIDPFlowAction and click OK.
  5. The code editor opens. Paste this code into the editor and save the file.

This is an out-of-the-box class that includes a method invoked by the flow you create on the next step. If you choose to use a different Apex class, make sure it includes such an invocable method.

  1. In the Developer Console, click File > New > Apex Class.
  2. Enter the class name: de_Extract_Document_AI_Details and click OK.
  3. When the code editor opens, paste this code and save the file.

You now have two Apex classes to use in the next steps:

  • dE_DataCloudIDPFlowAction
  • dE_ExtractDocumentAIDetails