2

In Summer 20, we have a possibility of define a "Run mode" of a Visual Flow, to run avoiding user permission, as we can see on this link: Run Flows That Bypass User Permissions.

But when you create a flow, with "System Context Without Sharing-Access All Data" option on "How to run flow" field and pulled it from Scratch org to your local branch, you receive a flow metadata (xml) without any reference to this "Run mode". In related link (Tooling API New and Changed Objects ), they refer to a runInMode field and SystemModeWithoutSharing (enum) option to set you flow without user permission... but it isn't on metadata. Look at this flow metadata example:

<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
    <interviewLabel>test {!$Flow.CurrentDateTime}</interviewLabel>
    <label>test</label>
    <processMetadataValues>
        <name>BuilderType</name>
        <value>
            <stringValue>LightningFlowBuilder</stringValue>
        </value>
    </processMetadataValues>
    <processMetadataValues>
        <name>OriginBuilderType</name>
        <value>
            <stringValue>LightningFlowBuilder</stringValue>
        </value>
    </processMetadataValues>
    <processType>Flow</processType>
    <screens>
        <name>test</name>
        <label>test</label>
        <locationX>430</locationX>
        <locationY>70</locationY>
        <allowBack>true</allowBack>
        <allowFinish>true</allowFinish>
        <allowPause>true</allowPause>
        <showFooter>true</showFooter>
        <showHeader>true</showHeader>
    </screens>
    <start>
        <locationX>50</locationX>
        <locationY>50</locationY>
        <connector>
            <targetReference>test</targetReference>
        </connector>
    </start>
    <status>Active</status>
</Flow>

Any ideas how to add this "RunInMode" and "SystemModeWithoutSharing" on flow metadata?

1 Answer 1

2

I just tried this and it works without any issues.

Here are couple of steps I recommend you double check,

  1. Make sure you are on latest version of SFDX CLI by running sfdx update
  2. Make sure the apiVersion is specified as 49.0

In your sfdx-project.json make sure it is 49.0

    "sourceApiVersion": "49.0",
1
  • 1
    Yes! I justed updated SFDX CLI, but the version was 47.0. Now I changed to 49.0 and works fine! Thanks a lot! Commented Jul 21, 2020 at 3:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .