-
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
Upload Files as Attachment using Apex Salesforce
Files replaced Attachments in Salesforce. Now any type of document upload becomes part of Files/Content in Salesforce. With all the other advantages over Attachments, the…
Omni-сhannel in Salesforce: Setting the Standard for Customer Service
Modern consumers demand convenience, connecting with companies from anywhere using smartphones or laptops. The true advantage emerges when customers have multiple options tailored to their…
Redefining the future of Marketing – Salesforce Marketing Cloud Integration with Google Analytics 360
Know your customers better and make smarter, insight-based marketing decisions through Salesforce’s massive customer relationship management platform twinned with Google Analytics 360’s market-leading digital analytics solution…
Popular Salesforce Videos
Slack "Work In Progress" Commercial | Where the Future Works | Success Anywhere | Salesforce
We are HERE. The future? We made it! Maybe it's not quite what we envisioned, but here's the thing: the future is forward movement from…
Create Survey in Salesforce | #Feedback Program #Salesforce Tutorials | Mini Project
In this video you will learn : What are the surveys? Why businesses use surveys? And how you can create and send surveys using #Salesforce? …
How to Manage Bulk Data in Salesforce?
Data is at the heart of everything you do in your business. It is also the engine that drives your Salesforce instance. Without it, how…