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
chessbasechessbase 

Need to get the user Security profile while importing users.

I am trying to import users from sforce into the application I am trying to ingrate with. Is there an easy way to get the user security profile? I don’t want to query every user at a time for its profile. Then again, I will get an Id of the profile which can lead me to the profile Name and the codes. I couldn’t find how they are mapped to the title, example System administrator is PT1 but couldn’t find documentation for this. Any help will be greatly appreciated.

bmfbmf

The standard profiles are as follows:

PT1 System Administrator
PT2 Standard User
PT3 Read Only
PT4 Solution Manager
PT5 Marketing User
PT6 Contract Manager

Here's how I determined this:

I ran SELECT Id, Name FROM Profile WHERE Name like 'PT%' (to find all the standard profiles). I then examined the list of ID values from the query and compared it to the URL of the Setup | Manage Users | Profiles links. Shortly after doing this, I realized that, of course, they are in reverse alphabetical order.

Of course, if you're duplicating users and their profiles, you would simply duplicate the users' profiles in the duplicate database, then match up the old ID values to the new, and copy the users over. A simple vlookup resolves this rather nicely.

bmf