0

I have a Flow that checks the Organization field "isSandbox" to determine whether or not to email a test address or a real address. However, when logged in as a non-admin user, this field is not accessible.

Is there a way around this or a better way to implement this?

FAST LOOKUP: orgType
Find all Organization records where:
Id Is null false
Sort records by: Id (Ascending)
Store the values of these fields in orgType: Id, IsSandbox
Result
Failed to find records.
________________________________________
Error Occurred: This error occurred when the flow tried to look up records: sObject type 'Organization' is not supported.. You can look up ExceptionCode values in the SOAP API Developer Guide.
2
  • You need to have 'View Setup and Configuration' enabled on the profile level to access Organization object and customer portal users can't access this object.
    – Vinay
    Nov 11 '20 at 18:41
  • Thanks for sharing. I will probably refrain from doing so, since that would be a little too much access for what I would like to achieve. The solution posted in the answers did work out for my needs.
    – Maya Tran
    Nov 11 '20 at 19:50
1

As of the Spring '20 release, you can set a flow version to always run in system context, bypassing the limited object/field permissions of the running user. (Assuming you're not depending on user permissions to hide/show different fields to different users, etc...)

Steps:

  1. Open the flow in Flow Builder.
  2. Click View properties.
  3. Click Show Advanced.
  4. For How to Run the Flow, select System Context with Sharing—Enforces Record-Level Access.

If you choose system context with sharing, the flow respects org-wide default settings, role hierarchies, sharing rules, manual sharing, teams, and territories. But it doesn’t respect object permissions, field-level access, or other permissions of the running user.

Source: https://help.salesforce.com/articleView?id=flow_distribute_system_mode.htm&type=5

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.