We are developing a LEX application and one of the requirements is that if another user has changed a specific value on the same record you are viewing, an instant notification is presented and the record state must change as a result.

It appears there are Push Notifications for the Service Console app, but is there a way we can create our own custom Push Notification for any object?

If Salesforce doesn't support custom desktop Push Notifications out of the box, can this be done with a 3rd party library?


With Winter 19, lightning:empApi can listen to platform events from such a DML. You would likely fire the platform event from a trigger or process builder on change event of your key fields and include the SObject recordID, current User ID, in its message payload.

Then, your listener component on the record page (of another viewing user) can check to see if the currently viewed recordID matches the payload recordID AND the current User IDs are different, then send an SLDS toast, SLDS prompt (seems appropriate here, as this is designed to stop workflow and you can refresh your data when they confirm it) or a more custom one.

You use to have to do this with a fragile cometD implementation, but it's now wrapped with a (hopefully more robust) version maintained by Salesforce themselves.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.