You need to sign in to do that
Don't have an account?
Nora Nicklis 32
Flow not properly running in system mode despite setting
I have created a flow that is set to run in system mode (System context without sharing).
Based on the documentation, this is supposed to ignore all object permissions.
The flow I have built is meant to create a record of an object that certain profiles don't have the create permission for. I assumed that, if I run the flow in system context this wouldn't cause issues for these profiles. But it does. All profiles that don't have create permissions for that object get an error when they launch the flow. When I change the profile it works fine.
To me that sounds like the behavior of the flow is different from what the documentation describes.
Does anybody have an idea on how to handle that? I tried opening a case with SF but it is considered a development case which is not covered by our support package so I was advised to post the question here.
Based on the documentation, this is supposed to ignore all object permissions.
The flow I have built is meant to create a record of an object that certain profiles don't have the create permission for. I assumed that, if I run the flow in system context this wouldn't cause issues for these profiles. But it does. All profiles that don't have create permissions for that object get an error when they launch the flow. When I change the profile it works fine.
To me that sounds like the behavior of the flow is different from what the documentation describes.
Does anybody have an idea on how to handle that? I tried opening a case with SF but it is considered a development case which is not covered by our support package so I was advised to post the question here.
Greetings!
By default,the screen flow runs in uder mode but when you launch a Flow using the Process Builder, then it will run in system mode.If you run the flow in "System Context Without Sharing-Access All Data" then this should not cause any errors if the profile doesn't have any required permissions.
Please refer the sample flow which will be created to run in System Context without sharing:
https://automationchampion.com/tag/run-a-flow-in-system-mode/
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri
Let me clarify a little bit.
The flow built is a screen flow, which I know runs in user mode by default, but I went into the flow settings to change it to run in system mode.
Here's a screenshot of the setting.
But even with this setting, when users with a specific profile run it, they get an error due to object restrictions.
@Craig: The way I understand system mode is that, in that case, I don't need to worry about any object/field permissions. Is that incorrect?
During the debug process I can set who to run the as and if I select the normal user, we get an error. If I select myself or an adming the flow runs.
Doesn't seem to matter of the API version, I've tried 53, down to 50.
Has anyone got this to work?
Im also runing flow as system and still getting permmission error
any workarond??
Try the below setting to resolve the ablove issue -
Setup->Create-> Workflows and Approvals -> Process Automation Settings
and set checkbox Enable record locking and unlocking in Apex as true
I got the same behaviour in API 55.
My workaround was to give the 'view all data', definitly not ideal, but since it was given in a permission set, it's a lesser of an issue.