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
HarrySieHarrySie 

Field not writeable for Permissionset ProfileID

Hello,

 

I tried to add a new  permissionset in a testclass for a user. When trying to create the new permissionset, For ID tells me: Field is not writeable for Permissionset.ProfileID. Here is the code:

 

permissionset ps = new permissionset(Name='TestPermissionset', ProfileId = '00eJ0000000QSA3', isownedbyProfile = true);

 

 What is the error here?

 

Thanks

Harald