Skip to main content

Error Occurred: INVALID_TYPE: sObject type 'CustomNotificationType' is not supported.

I have created a Custom Notification Type.

I am calling it from a Flow, where I have inserted the correct Id for it and provided all the params. When invoked from the Debugger, it works fine. However, when invoked from a Process triggered by a Platform event, I get an error:

Error Occurred: INVALID_TYPE: sObject type 'CustomNotificationType' is not supported.

Since it works from debugger (in Flow Builder), but not when called from a Process, I'm wondering if user context has anything to do with it? I tried without SenderId and also including the SenderId, set to the Admin's Id. Still doesn't work.

10 Kommentare
  1. 14. Feb. 2023, 16:02

    @Kunal Khattry, thanks for the input. Again, the issue with that is the user profile that initiates this sequence is Guest Site User (incoming text from Twilio), and that profile is limited. 

    I recently discovered that if trigger a flow from a platform event, it runs in the user context of whatever caused the platform event. So, in this case, the flow would run in Guest Site User context. However, if you write a trigger on that platform event, the trigger runs in Automated User context. So that trigger can either fire a new platform event (though this would eat into your platform event limits), or it could call a flow -- which would then run in Automated User context. (And, BTW, even if you save your flow to run as System context, it somehow manages to retain that Guest Site User context.)

0/9000