From the time custom notification is introduced in salesforce(Summer 19), it has been kind of replacing the extra use of Email alerts and Chatter post . Previously these were two ways to notify the user (Desktop/ Mobile ).
So let us see how this is used.
1.Go to Setup >> Type Custom Notifications.
2. Click on New . Enter Name and Supported Channel and Click on Save.
Once this is done . Go to setup click on Notification Delivery Setting.
Select the Custom Notification you built.
Once done , Click on Save . Now your custom notification is saved and is ready to use by Process builder .
So i will create a process builder that will notify me once Opportunity is Closed Won or Closed Lost.
After this you can activate the Process builder . Now its time to test.
Below is Desktop Notification .
Below are the mobile notifications
Now we will look at how to use it inside flow. For now , i will use the same custom notification and Process Builder to invoke the flow. You may have a question that if we already have the option to invoke this through Process builder then why do we need flow.
Answer is simple, there may be chance that maximum of bussiness logic that you have may be inside the flow, so i am basically showing how to invoke the custom notification from Flow .
Our Flow will be Auto launched flow which will look like :
Get Records will fetch the Custom Notification Record Id which will be passed to Action which will have action as notification as shown below.
Now we will configure the Action, by creating variables and using them inside action , value to these variable will be given by Process builder .
|Custom Notification Type ID||The ID of the Custom Notification Type being used for the notification.This parameter accepts single-value resources of any type. That value is treated as text. I have used Get Records to fetch this ID .|
|Notification Body||The body of the notification, as it will be seen by recipients|
|Notification Title||The title of the notification, as it will be seen by recipients.This parameter accepts single-value resources of any type. That value is treated as text and is limited to 250 characters.|
|Recipient IDs||The ID of the recipient or recipient type of the notification.Valid values are:|
User ID—The notification will be sent to this user, if this user is active.
Account ID—The notification will be sent to all active users who are members of this account’s Account Team. Valid only if account teams are enabled for your org.
Opportunity ID—The notification will be sent to all active users who are members of this opportunity’s Opportunity Team. Valid only if team selling is enabled for your org.
Group ID—The notification will be sent to all active users who are members of this group.
Queue ID—The notification will be sent to all active users who are members of this queue.This parameter accepts collection variables of type Text and is limited to 500 values. I am passing this via Process Builder
|Target ID||The Record ID for the target record of the notification.This parameter accepts single-value resources of any type. That value is treated as text.|
I am passing this via Process Builder
Once this is done Save the flow and Activate the flow. Now we will make the Changes to Process builder.
Activate the process builder and we are good to Test. Results will be same so please try it yourself.
Please Try this in our Dev org and let me know the feedbacks .
NB. This is only for Demo purpose .There may be scenarios when this Process builder and Flow may require bulkification.
Thanks !!! Stay Safe Stay Home