1

When using Salesforce UI, it's possible to clone a Profile. This is handy, because we can clone the Minimum Access - Salesforce Profile which includes almost the bare minimum permissions.

However, while creating a new Profile via the Metadata API, even though the Metadata in itself is almost empty, lots of Permissions/Tab access/Objects access will be provided.

To avoid that, I would like to clone an existing Profile to be sure no extra permissions will be added at creation.

Is there a way to clone an existing Profile using any Salesforce API ?

1 Answer 1

1

You can achieve this using the readMetadata API. You specify the metadata type and fullName and this will pull down the entire profile including objects, fields, etc.

What I do is I use a Chrome extension called Wizdler and then navigate to Setup -> Integrations -> API and then click on the Metadata WSDL.

From there the Wizdler Chrome Extension should parse the WSDL and then allow you to generate the request to retrieve the profile:

enter image description here

enter image description here

You will have to grab your session Id (I do this via Browser Cookies) and replace the target URL at the top with your domain

3
  • 1
    That's not as easy as just having a clone operation, but it looks like that I can make it work like this. I was aware of Profile Metadata in the Tooling API, but not via this readMetadata operation and it seems to contain everything I need to script that, thanks ! I'll accept it as best answer as I think it's the closest we can get from cloning with actual Salesforce APIs. Commented Apr 6, 2023 at 13:05
  • Yeah this is the "old" synchronous metadata API. You can def clone an entire profile this way. I have also done the same thing in a nodeJS program via JSForce (jsforce.github.io/document/#read-metadata) Commented Apr 6, 2023 at 13:32
  • 1
    That's what I used to try your answer, working fine :) Commented Apr 6, 2023 at 13:47

You must log in to answer this question.

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