-
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
Top 10 Features of Code Completion for Lightning in JetForcer IDE
Today, I would like to tell you about the top 10 code completion features in JetForcer IDE, which indeed save time during developing Lightning applications.…
Optimize Salesforce Pardot Capabilities with Migration to Lightning Experience
Marketing automation is the key to building a successful business strategy. With so many market automation tools available, Pardot is one of its kind. It…
Learn Salesforce Einstein – Chapter 3 (Einstein Key Setup)
Do you have a key? If you have key then upload your key file here. If you don't have key then follow the below steps.…
Popular Salesforce Videos
Algoworks is Now a Salesforce Gold Partner
Being just a registered partner back in 2013, the journey to striking Gold in 2020 has been long. On the way to getting that Gold,…
Salesforce Platform Quick Tip: How to Access Popular Items in a Single Click
Want to get to the things you use most with fewer clicks? Trailblazer and Senior Salesforce Developer, Ellie Matthewman shows us how to use favourites…