Use a Formula Field to Render a Similar Accounts Field

Create a multiline text formula field to show the similar accounts you get from the model. Here's how you create the field:

  1. Enter an active sandbox.
  2. Navigate to Configuration > Application Composer > Standard Objects > Account > Fields.
  3. On the Fields page, click Actions > Create.
  4. Select Formula and click OK.

    To learn more about the formula fields, read the Formula Fields topic in the Configuring Applications Using Application Composer guide.

  5. On the Create Formula Field page, enter a Display Label. Enter the same name but without spaces, in the Name field.
  6. Select Display Type as Multiline Text Area.

    The formula field will appear as a multiline text area to display the similar accounts.


    Create a custom field using the formula field for showing similar accounts.
  7. Click Next.
  8. On the Configure Expression page, enter the formula value in the following format:
    adf.util.InvokeSalesMLQueryAPI("<Prediction Model Usecase
            Code>","<Primary  Key Field Name>",<Primary
          Field Value>)
    For example, adf.util.invokeSalesMLSimilarRecordsQueryAPI("CX_SIMILAR_ACCOUNTS","partyid",PartyId).
    Enter the expression for the formula field.
  9. Click Submit.

    You can now add the similar account field to an object page.