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
Lasith SameeraLasith Sameera 

The permissionSet ID returns from API is different than the display one

Hi,

I have permission set created lets say the ID of it XXXX. So I can see that permission set information via http://<salesforce_url>/XXXX. 
When I query permission set data from PermissionSetAssignment via API. The PermissionSetAssignment.PermissionSet.ID have a different value for the same permission set. 
For example that id value is similer to XXXXGAO. Anyhow I can access permission set via http://<salesforce_url>/XXXXGAO.

So what is the relationship between XXXXGAO and XXXX? If I have XXXXGAO how can I retrieve XXXX and vice versa? 

Thanks!
pconpcon
Is the length of the Id XXXX 15 characters and the XXXXGAO 18 characters long?  If so this is just a excentricity of the platform.  The Id field can both be represented by it's 15 character version or it's 18 character version.
Lasith SameeraLasith Sameera
Hi,

Thanks for reply. I just checked for with one permission set and there yes 15/18 length rule is true.

Anyway is there a way that we can get XXXX when we have XXXXGAO and vice versa?
pconpcon
You can just do
myId = myId.substring(0, 15);

Is there any technical reason to do so?  No.  Salesforce will behave the same regardless of if you are using the 15 or the 18 char id.