Activity Forums Salesforce® Discussions Dynamic query field values to custom setting fields?

  • Gourav

    Member
    June 2, 2016 at 1:58 pm

    You add the fields to the custom setting through the Setup UI or through other tools. Then you use the "Manage" option to edit the setting. To reference it in code (assuming it is a list custom setting that you need a key for):

    BatchCriteria__c bc = BatchCriteria__c.getInstance(keyValue);

    String whereTerm = '';
    if (!String.isEmpty(bc.Where1__c)) whereTerm += bc.Where1__c;
    if (!String.isEmpty(bc.Where2__c)) whereTerm += bc.Where2__c;
    if (!String.isEmpty(bc.Where3__c)) whereTerm += bc.Where3__c;
    if (!String.isEmpty(bc.Where4__c)) whereTerm += bc.Where4__c;

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Free 5 Day Salesforce Challenge!

Video in

To access the signup form head over to www.talentstacker.com/Salesforce TalentStacker Podcast Salesforce Episode: https://talentstacker.libsyn.com/how-to-earn-60k-100k-a-year-within-6-months-without-a-college-degree-say-what-salesforce-career-development-path-with-bradley-rice Do you already have a job as a Salesforce Professional and…