ActionableNotification.Builder Class

Contains methods to build an instance of the Messaging.ActionableNotification class, which is used to configure actionable notifications for mobile devices.

Messaging

See the example for the Messaging.ActionableNotification class.

The following are methods for ActionableNotification.Builder.

Returns an instance of the Messaging.ActionableNotification class.

public Messaging.ActionableNotification build()

Type: Messaging.ActionableNotification

Sets the unique action identifier (API name) for the custom notification action.

This actionIdentifier must belong to the action group associated with the custom notification.

public Messaging.ActionableNotification.Builder withActionIdentifier(String actionIdentifier)

  • actionIdentifier:

    Type: String

    The API name of the action.

Type: Messaging.ActionableNotification.Builder

Sets the ID of the custom notification type.

public Messaging.ActionableNotification.Builder withNotificationTypeId(String notificationTypeId)

  • notificationTypeId:

    Type: String

    The ID of the custom notification type being used for the notification. A notification type is required to send a custom notification.

Type: Messaging.ActionableNotification.Builder

Sets the user ID of the custom notification recipient.

public Messaging.ActionableNotification.Builder withRecipientId(String recipientId)

  • recipientId:

    Type: String

    The user ID of the notification recipient.

Type: Messaging.ActionableNotification.Builder

Sets the sender of the custom notification.

public Messaging.ActionableNotification.Builder withSenderId(String senderId)

  • senderId:

    Type: String

    The user ID of the sender of the notification. Setting a sender is optional.

Type: Messaging.ActionableNotification.Builder

Sets the record ID for the target record of the notification.

You must specify either a targetID or a targetPageRef.

public Messaging.ActionableNotification.Builder withTargetId(String targetId)

  • targetId:

    Type: String

    The ID of the target record.

Type: Messaging.ActionableNotification.Builder

The PageReference for the navigation target of the notification.

You must specify either a targetID or a targetPageRef.

public Messaging.ActionableNotification.Builder withTargetPageRef(String targetPageRef)

  • targetPageRef:

    Type: String

    The target page reference as a URL string, for example '/lightning/r/Case/500XXXXXXXXXXXXYAI/view'. For more examples, see pageReference Types.

Type: Messaging.ActionableNotification.Builder