ActionableNotification.Builder Class

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

Namespace

Messaging

Example

See the example for the Messaging.ActionableNotification class.

ActionableNotification.Builder Methods

The following are methods for ActionableNotification.Builder.

build()

Returns an instance of the Messaging.ActionableNotification class.

Signature

public Messaging.ActionableNotification build()

withActionIdentifier(actionIdentifier)

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

Signature

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

public Messaging.ActionableNotification.Builder withActionIdentifier(String actionIdentifier)

Parameters

actionIdentifier
Type: String
The API name of the action.

withNotificationTypeId(notificationTypeId)

Sets the ID of the custom notification type.

Signature

public Messaging.ActionableNotification.Builder withNotificationTypeId(String notificationTypeId)

Parameters

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.

withRecipientId(recipientId)

Sets the user ID of the custom notification recipient.

Signature

public Messaging.ActionableNotification.Builder withRecipientId(String recipientId)

Parameters

recipientId
Type: String
The user ID of the notification recipient.

withSenderId(senderId)

Sets the sender of the custom notification.

Signature

public Messaging.ActionableNotification.Builder withSenderId(String senderId)

Parameters

senderId
Type: String
The user ID of the sender of the notification. Setting a sender is optional.

withTargetId(targetId)

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

Signature

You must specify either a targetID or a targetPageRef.

public Messaging.ActionableNotification.Builder withTargetId(String targetId)

Parameters

targetId
Type: String
The ID of the target record.

withTargetPageRef(targetPageRef)

The PageReference for the navigation target of the notification.

Signature

You must specify either a targetID or a targetPageRef.

public Messaging.ActionableNotification.Builder withTargetPageRef(String targetPageRef)

Parameters

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