0

The context is simple : I need to copy metadata (spec. the Visualforce Page Access from a certain profile)from one org to another with some edition on the fly.

Someone suggested me to use the Force.com Migration Tool, as there are numerous metadata.

I followed the guide provided by Jeff Douglas for the beginning. So far so good, I was able to retrieve/deploy some easy metadata (apex class/visualforce pages).

I'm facing issues when I try to retrieve the metadata on a profile, and specifically on the ProfileApexPageAccess field.

My package.xml looks like this

<types>
    <members>MyProfileName</member>
    <name>Profile.ProfileApexPageAccess</name>
</types>

When I command-lined ant retrieveUnpackaged, I expected different results

<userLicense>MyProfileName</userLicense>
<userPermissions>
    <enabled>true</enabled>
    <name>AllowUniversalSearch</name>
</userPermissions>
<userPermissions>
    <enabled>true</enabled>
    <name>ApiEnabled</name>
</userPermissions>

What am I doing wrong ? Thanks in advance

1 Answer 1

2

To fix this, you need to also specify the page that you want to retrieve the permissions for. For example:

<types>
    <members>MyProfileName</member>
    <name>Profile</name>
</types>
<types>
    <members>*</member>
    <name>ApexPage</name>
</types>

This is noted in the documentation:

The content of a profile returned by Metadata API depends on the content requested in the RetrieveRequest message. For example, profiles only include field-level security for fields included in custom objects returned in the same RetrieveRequest as the profiles taken from

This is one of the many, many, many, many things we've had to bake into Gearset as we've built it. Shameless plug but we have a fully featured 30 day trial with zero lock-in and nothing to install in your org that you might want to try out to copy the metadata - should be easier than learning about package.xml intricacies!

2
  • Indeed it works. Thank you for your response. Although I also figured that if I were to push the profile metadata, I was going to overwrite the apex pages. As I'm working on a project with multiple devs, I should do it when everyone is asleep or not working. It may be an asset for a bulk of metadata. But not in my case. Great tool though ! Fairly easy to use Apr 18, 2016 at 11:27
  • You used Gearset and it solved your issue? Really glad to hear. Feel free to reach out to me at kevin@gearset.com if you want more info on anything that we do, working with a dev team on Salesforce is a tricky business but we (and others) are working to make it easier :) Apr 18, 2016 at 11:58

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.