How to check whether a userid exists in List Custom settings in Salesforce?

How to check whether a userid exists in List Custom settings in Salesforce?

Sample Code:

if ( CustomSettingsName__c.getValues(UserInfo.getUserId()) != null ) {
    //do something since it contains the user id
}

Cheers!!!

Leave a Reply