Step 3 - Create Apex Classes
Create two custom Apex classes to enable the Document AI flow functionality.
- Go to the Setup Menu.
- From the dropdown menu, select Developer Console.
- In the Developer Console, click File > New > Apex Class.
- Enter the class name:
de_DataCloudIDPFlowActionand click OK. - 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.
- In the Developer Console, click File > New > Apex Class.
- Enter the class name:
de_Extract_Document_AI_Detailsand click OK. - 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_DataCloudIDPFlowActiondE_ExtractDocumentAIDetails
- Step 4 - Create the Screen Flow: Create a new screen flow in Flow Builder to orchestrate Document AI and update the Contact record.