Open marioluissc opened 7 months ago
Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.
Unfortunately metadata API support for Profiles isn't great. Customers have reported similar issues in the past (see this comment).
I'm going to mark this as owned by another team
since we don't own the metadata API or Profiles.
We have determined that the issue you reported exists in code owned by another team that uses only the official support channels. To ensure that your issue is addressed, open an official Salesforce customer support ticket with a link to this issue. We encourage anyone experiencing this issue to do the same to increase the priority. We will keep this issue open for the community to collaborate on.
You should use Permission Sets for access :)
Summary
<flowAccesses>
not included on Profile xml metadata when retrieving metadata using sf CLIproject retrieve start
by Package Name (-n
) attribute.Example CLI:
sf project retrieve start -t path/to/dir -n {CHANGE_SET_NAME} --api-version 60.0
Steps To Reproduce
a) Create a simple Screen Flow (the logic or content of the flow is not relevant). b) Edit Access for the flow just created, then add permission to execute the flow to at least 1 Profile. example:
c) Create a Outbound Change Set, give it a name (the name will be used on the CLI later) d) Add the "Flow Definition" component created on step a) the change set e) Add the "Profile(s)" that you configured on step b) to the change set f) Run the following CLI, replacing the CHANGE_SET_NAME with the name you gave to your change set.
g) On the package retrived, open one of the profiles files retrived (eg. profileName.profile) and notice that
<flowAccesses>
node is not included on its content.So when I try to deploy the package to another org, the flow permission are lost.
Extra Information and some extra tests I did: This is the package.xml resulted from the CLI above:
Inspired on this article https://gearset.com/blog/what-is-the-salesforce-metadata-flowaccesses/ I modified the package.xml above and included a "FlowDefinition" metadata type as per below.
then I ran the following CLI based on the package manifest above
and voila!! now the profile metadata was retrieved with the content.
As per the article and salesforce own documentation, FlowDefinition type was deprecated a while back, so I wonder why is it necessary in this case and b) why retrieving metadata by the package name would not included it automatically.
Expected result
The profile file retrieved should contain a XML node as per below:
Actual result
<flowAccesses>
content is not present in the profile metadata.System Information
MacOS -> Terminal on VS Code
Additional information