Get ID of Custom Notification Type in Salesforce

Get ID of Custom Notification Type in Salesforce
Get ID of Custom Notification Type in Salesforce

In my last post I have told you How to Send Push Notification in the Salesforce Desktop and Mobile App, So today I will tell you how you can get the ID of Custom Notification Type in Salesforce.

With Summer ‘19 release new feature in Salesforce called ‘Notification Builder’ is now finally available. But with some limitation!

So, if we want to send notification via flow instead of process builder or when we want to publish it with Rest API then we need to input ID of Custom Notification Type. So how we get to know the ID?

  • By navigating your way through Setup to the Custom Notification Type? Well, you can try you won’t find it.
  • The object was not API accessible, before Summer’19 release. So it is not possible to do SOQL query/Apex.

Let us have a walkthrough how to get ID of Custom Notification Type.

There are 3 ways you can find the ID of Custom Notification Type.

1. Developer Console:

Click on the gear icon on the top right corner and open ‘Developer Console’ and SOQL Query.

Select Id,CustomNotifTypeName from CustomNotificationType

2. Process Builder

In this step, we will create a Process Builder and select action ‘Send Custom Notification’ and follow these steps.

  1. Go to Setup → Process Builder → Create new
  2. Select your object, and if this should fire only on create or create and edit
  3. Add the Criteria you want
  4. Create New Action → select ‘Send Custom Notification’
  5. Enter the name of Action
  6. Select the Notification Recipient it can be Owner, User, Group, Queue, totally up to you.
  7. Enter the Notification Title and Notification Body
  8. Activate the Process Builder.
Select the Notification type from dropdown and select

3. Workbench:

In Summer’19 release CustomNotificationType is accessible as sObject via Tooling API. So, query on this as Dev console.

– Go to the Workbench( Tooling API )- https://workbench.developerforce.com
– Select Rest Explorer under ‘Utilities’.
– Then select Method to GET, and execute the below URL:

/services/data/v45.0/tooling/query/?q=SELECT+id,CustomNotifTypeName+from+CustomNotificationType

In addition, learn how to use Send Push Notification in Salesforce Desktop and Mobile App to create and send push notification.

Resource

MoreoverIf you have any suggestions or issue with the post, you can reply in the comment box.

Support:  Thank you for being an awesome reader! For any further Salesforce support/ customisations, Chat with us

Parul Singh

I’m a Salesforce Certified Service Cloud Consultant, Certified Administrator & Certified Platform Developer. I have 2 years of experience, currently working on Field Service Lightning, Lightning Flows and Learning Lightning Web Component. I was featured in the top Salesforce Bloggers of 2018 by www.forcetalks.com

You may also like...

Want to know more about Salesforce Devlopments?

We keep your data private and share your data only with third parties that make this service possible. Read our Privacy Policy.

Holler Box