-
Custom setting not displying correct picklist values based on the condtion
i have a custom setting called the product and under that, I created two fields called and other is string field BD__c. i want to display picklist value based on string matching record. my custom setting looks like AAA |1,2,6,8 BBB |1,2,6,8 NNN|8 so when string value is 1,2,6,8 it should show AAA, BBB when its 8 it should show NNN, but i can see all the values even if BD__c==8
Here is my apex controller method. can someone suggest me what I am missing
public List < SelectOption > getTR_picklistvalue() { system.debug('******Start of getTR_picklistvalue'); List < SelectOption > options = new List < SelectOption > (); options.add(new SelectOption('', '--Select--')); Map < String, picklistvalue__c > Prod = picklistvalue__c.getAll(); List < String > keys = new List < String > (Prod.keySet()); keys.sort(); for (String key: keys) { if (Prod.get(Key).BD__c == '1,2,6,8') Options.add(new SelectOption(Prod.get(Key).picklistvalue__c, Prod.get(Key).Name)); else Options.add(new SelectOption(Prod.get(Key).picklistvalue__c, Prod.get(Key).Name)); //options.sort(); } return options; }
Log In to reply.
Popular Salesforce Blogs
Leveraging Salesforce’s Complimentary Data Cloud and Tableau Licenses
In the ever-evolving landscape of business, access to valuable data insights and powerful analytics tools is essential for sustainable growth. Salesforce, a leader in customer…
Right Salesforce Partner Help You to Grow Your Business with Technology
As we all are familiar with, consulting firms have become the most reliable method for everyone to get their jobs done quickly. Just throw a little…
Plauti Offers Flow Action Capabilities on Duplicate Check for Salesforce AppExchange
Plauti today announced it has updated Duplicate Check on Salesforce AppExchange, providing customers new ways to integrate the checking and merging of duplicate records into their…
Popular Salesforce Videos
Set Access for Lightning Knowledge ‐ Set Up Salesforce Knowledge
User permissions control access to different tasks. Using permission sets or custom profiles you can grant Ada the article-related permissions she needs. Create a permission…
Salesforce for Marketing
Learn how to bring marketing and engagement together. Salesforce Marketing Cloud helps you connect marketing, sales, service, and more on a single platform. Marketers get…
Google Gantt Chart with Colorful Bars in Salesforce Lightning
In this video, you will learn to implement the Gantt Chart with colorful bars in your Salesforce org. We will use Google Gantt Chart scripts…