function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AdamAAdamA 

API create new Profile Object (Where did my Discussion message go??)

Stackoverflow  [NOTE]  I think IE 9.0 does not work.  I switched to compatability mode and now I can post messages.

 

I am attempting to create a new Profile object through the API.  The doc shows that the Profile object does have a create() method, but when I attempt to create a new Profile I receive an error stating, “entity type cannot be inserted: Profile”.  I have run a describeSObjects(new string[]{"Profile"}); and I have found the DescribeSObjectResult has a creatable = False.  Is there a way to use the API to create new Profile objects? 

 

sfdcfoxsfdcfox

You can't use the regular API to create or modify profiles. Instead, use the metadata API to achieve this effect. Full documentation is on the documentation section of this site, plus you can see the methods available by downloading the appropriate WSDL from Setup > Develop > API.

Mark SFMark SF

Thanks for pointing out the error in the documentation. This will be corrected this week.

 

As the other poster noted, you can add a profile with the Metadata API.