Creating a custom action event

In most cases you can use the pre-defined trigger events in HCM to initiate actions at the points you want in a process. If you need email notifications when a record is created or updated but no standard action events are available to send the notifications, you can also create your own custom action events using Salesforce Flows.

Create a custom action event

  1. Select the Action Event Patterns tab and select a view showing the action event pattern you want to extend with the custom action event.

  2. Select the Action Event Pattern name:

    Screenshot: Selecting an Action Event Pattern from a list view

    Sage People displays the Action Event Pattern Detail page:

    Screenshot: Action Event detail page

  3. In the Action Events section, select New:

    Sage People displays the Action Event page:

    Screenshot: New Action Event page

    This page enables you to define for each action event:

    • The trigger event.

    • The conditions to be met for the event to be sent.

    • Who is to receive it.

  4. Complete the Event field as follows: 

    1. Select the Event picklist and choose Custom.

    2. Select the second picklist and choose ?.

      Sage People displays a new text field below the picklist.

    3. Enter a name for the event. This name is used in the Flow.

  5. Select the Email Template to use when sending the email. If you need a new email template for this action event, first create it, and then select it in this event.

  6. Scroll to the Recipients section and select the recipients you want to notify.

    Tip

    Select one or more of the standard options for recipients. Custom Action Events cannot use the Send to Email Addresses option.

  7. Select Save.

Example: Create a Flow to send an email notification when an HR request has been approved

For more information about Flows, see the overview.

  1. Go to Setup > Platform Tools > Process Automation > Flows.

  2. Select New Flow.

    Sage People displays the New Flow dialog.

  3. Select Record-Triggered Flow and then select Create.

  4. On the Configure Start screen:

    1. Select Object and start typing the name of the object—in this example, HR Request. Select HR Request.

    2. For Configure Trigger, select A record is created or updated.

    3. For Set Entry Conditions, consider if you need an entry condition for the Flow. Then select Condition Requirements and choose the most appropriate option. Use the picklists, text area and the Check Syntax button to enter a valid entry condition.

      For example, you could define only HR Requests with an Approval Date entered can enter the Flow, as shown in the following screenshot: 

      Screenshot: Set Entry Conditions section with an entry condition formula for non-blank Approval Dates

      Copy
      Formula as shown in the screenshot
      ISNULL({!$Record.fHCM2__Approved_Date__c}) = false
    4. For When to Run the Flow for Updated Records, select Every time a record is updated and meets the condition requirements.

    5. For Optimize the Flow for: select Actions and Related Records.

  5. Select Done.

    Sage People displays the Flow Builder canvas.

  6. On the canvas, select + between the Start and End elements to add an element.

  7. Select Decision:

    Screenshot: Selecting Decision from the Add Element dialog

  8. On the New Decision dialog, enter a Label and an optional Description. API Name is automatically completed based on the Label.

    For example: 

    Label: Is the HR Request approved? 

    Description: Determines if the HR Request is approved

  9. In the Outcomes section, enter a Label for Outcome Details. Outcome API Name is automatically completed based on the Label.

    For example: Yes

  10. Complete the other details as follows: 

    1. For Condition Requirements to Execute Outcome, select All Conditions Are Met.

    2. Use the Resource, Operator, and Value fields to enter conditions. Use Add Condition to add more conditions if required.

      For example: 

      Resource Operator Value
      {!$Record.fHCM2__Approved_Date__c} Is Changed {!$GlobalConstant.True}
    3. For When to Execute Outcome, the option If the condition requirements are met is automatically selected if you use the Is Changed operator.

    Screenshot: Outcome details for a decision path

  11. On the sidebar, select Default Outcome.

  12. Change the Label of the default outcome to something more meaningful for this Flow, such as Not approved.

  13. Select Done.

  14. On the Flow Builder canvas, in the Yes decision branch, select + to add an element.

  15. Select Action.

  16. On the New Action dialog, select Action and start entering "custom":

    Screenshot: Selecting the Custom Action Event action

  17. Select Custom Action Event.

  18. Enter a Label and an optional Description for the action. API Name is automatically completed based on the Label.

    For example: 

    Label: Custom HR Request action event

    Description: Sends an email notification when an HR Request is approved

  19. Complete the fields in the Set Input Values section as follows: 

    Field What to enter
    eventName The name of the event you entered when you created the custom Action Event.
    objectId {!$Record.Id}
    Team Member ID {!$Record.fHCM2__Employment__r.fHCM2__Team_Member__r.Id}

    Leave other fields at default values:

    Screenshot: Entering input values for a Flow action

  20. Select Done.

  21. On the Flow Builder canvas, select Save to give the Flow a name and save it.

  22. Select Activate to make the Flow active. You can use the debug option for checking the Flow before you activate.