Get the custom setting values in the apex code




Let Example__c  be your Custom settings name and Active__c be one of your Field.

Code:

To get All the values
List<Example__c > mcs = Example__c .getall().values();
system.debug(mcs);

To get Particular Field Value
list<Example__c > a = [Select Active__c From Example__c ];

To get the single record Value with Name 'Test1'.

Example__c test= Example__c .getValues('Test1');
system.debug(test);



P.S: Comment Below for any Clarification or help!!

Happy working!! :) :) 

Comments

Popular posts from this blog

Embed Special Characters in VF Page

Error: Compile Error: Illegal conversion from String to System.PageReference

Some Common Errors in the Visual flow