Creating a Custom Action

Tip:

Additional automated methods are available to make your messaging setup quicker and easier. For more information, see Relationship Activation Overview.

You can use the Salesforce Process Builder to create a custom action to be carried out on a declarative publication that you have created. You can specify an Apex action to be carried out on an object and add criteria associated with that object that determines when the action is to be carried out.

Note:

We recommend that you create an immediate custom action, however you can create a scheduled custom action and set a schedule for it. A schedule is useful if you regularly create large volumes of data.

Creating an Immediate Custom Action

To create a custom action that is executed immediately:

  1. From Setup, click Create | Workflows & Approvals | Process Builder.
  2. Click New.
  3. Enter a process name.
  4. Enter a description of the process.
    Note:

    When you click in the Description field, Process Builder automatically populates the API name field. The API name is created using the process name that you entered. The API name must be unique.

  5. Click Save.
  6. Click + Add Object
  7. Select the object for which you are creating the process.
  8. Select the criteria that determines when the process is started then click Save.
  9. Click + Add Criteria.
  10. Enter the criteria name.
    Note:

    The criteria name appears on the canvas to help you distinguish the criteria and its action group from the other criteria and action groups in the process. You have to define the criteria that must be true before the process can execute the associated actions.

  11. Select the criteria for executing actions:
    • Conditions are met – The action runs when the conditions you provide are met. This is the default.
    • Formula evaluates to true – The action runs when the formula you enter evaluates to true.
    • No criteria – The action runs without meeting any conditions or formulas.
  12. Click Save.
  13. Click + Add Action.
  14. Select Apex from the Action picklist.
  15. Enter an action name.
  16. Select "Send FDN Messages Synchronously" from the ApexClosed Salesforce's object-oriented, on-demand programming language. Class drop-down list.
  17. Copy the identifier of the publication that you are creating the action for and paste it into the Publication Value field.
  18. Select "Reference" from the Type drop-down list next to the Record ID field.
  19. Click the Record ID field then choose the Record ID field for the record that you are creating the custom action for.
  20. Click Save.
  21. Click Activate to activate the process.

Creating a Scheduled Custom Action

To create a scheduled custom action:

  1. From Setup, click Create | Workflows & Approvals | Process Builder.
  2. Click New.
  3. Enter a process name.
  4. Add a description of the process.
    Note:

    When you click in the Description field, Process Builder automatically populates the API name field. The API name is created using the process name that you entered. The API name must be unique.

  5. Click Save.
  6. Click + Add Object.
  7. Select the object for which you are creating the process.
  8. Select the criteria that determines when the process is started then click Save.
  9. Click + Add Criteria.
  10. Enter the criteria name.
    Note:

    The criteria name appears on the canvas to help you distinguish the criteria and its action group from the other criteria and action groups in the process. You have to define the criteria that must be true before the process can execute the associated actions.

  11. Select the criteria for executing actions:
    • Conditions are met – The action runs when the conditions you provide are met. This is the default.
    • Formula evaluates to true – The action runs when the formula you enter evaluates to true.
    • No criteria – The action runs without meeting any conditions or formulas.
  12. Click Save.
  13. Click + Add Action.
  14. Select Apex from the Action picklist.
  15. Enter an action name.
  16. Select "Send FDN Messages Asynchronously" from the ApexClosed Salesforce's object-oriented, on-demand programming language. Class drop-down list.
  17. Copy the identifier of the publication that you are creating the action for and paste it into the Publication Value field.
  18. Select "Reference" from the Type drop-down list next to the Record ID field.
  19. Click the Record ID field then choose the Record ID field for the record that you are creating the custom action for.
  20. Click Save.
  21. Click Set Schedule.
  22. Enter the criteria you want to use to determine when the action executes.
  23. Click Save.
  24. Click Activate to activate the process.

Adding Criteria to an Active Process

To add more criteria to an active process clone it, make the changes you want and then activate it.

Note:

When you activate the cloned process, the active process is automatically deactivated and the new process is activated.