2

Very simply:

SELECT Id FROM PermissionSet WHERE Type='Regular'

returns nothing.

Type is a PickList and I have plenty of example data where the Type is Regular. Is this a bug? It is a bad one, because (for example) you don't normally want to look at PermissionSets where the type is Profile.

2
  • 2
    Sure seems like a bug to me. I am able to reproduce. I checked the describe to see if the options have a different label than value, but actually the label is null and the value is what you are filtering on.
    – Adrian Larson
    Commented Oct 25, 2019 at 21:38
  • weird, schema says field is filterable
    – cropredy
    Commented Oct 26, 2019 at 19:29

1 Answer 1

1

It is weird but you can do something to get those ids. Try this on you developer console and you can get the ids for those PermissionSets with Type = Regular, is the only way I know :) :

List<Id> idList = new List<Id>();
List<PermissionSet> listofTypes =[
   SELECT Type, Id 
   FROM PermissionSet 
   WHERE Type != null];

System.debug(listofTypes.size());

for(PermissionSet per : listofTypes) {
  if(per.Type == 'Regular') {
     idList.add(per.Id);
   }
}

System.debug('PermissionSets amount with Type regular: ' + idList.size());

PermissionSet theOnePer = [ SELECT Type FROM PermissionSet WHERE Id = :idList[0]];
System.debug('The type is? : ' + theOnePer.Type);

enter image description here

You must log in to answer this question.

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