I have a picklist on a visualforce page and I'm trying to filter by namespace prefix to display objects belonging to a package as well as the account and contact objects. I have the for loop below that is adding the objects label and api name to the list. I've tried adding an if statement using mapKeys.contains('xyz'), but the options list is empty.
Here is a debug of mapKeys which is a made of the label and api names combined.
[109]|DEBUG|options (62 Org Case (agf__ADM_Case__c), ADM Platform Cache Metadata (agf__ADM_Cache_Metadata__mdt), API Event (ApiEvent), Account (Account), ...).
Any help getting the if statement corrected, or advice would be appreciated.
for(string s: mapKeys){
if(mapKeys.contains('Account')){
options.add(new SelectOption(objectLabelToNameMap.get(s),s));
}
}
return options;
}
mapKeys
is instantiated as namespace data is available in the Schema.Describe methods