-
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
Making Salesforce Documentation a Habit
Let’s talk about an essential aspect of Salesforce that often gets overlooked: documentation. Salesforce has transformed customer relationship management for businesses everywhere, but without proper documentation, Salesforce…
Top 7 Reasons To Choose Salesforce For Your Business
Description: Salesforce is one of the world leaders in the development of cloud-based CRM solutions. We'll talk about why it is important for your business.…
The Essential Guide for Salesforce Testing
Organizations in the modern business environment rely on robust customer relationship management (CRM) systems to efficiently manage and streamline their sales processes. Salesforce, a leading…
Popular Salesforce Videos
COVID 19 Tracker in Salesforce Lightning Aura Component
In this video, we are developing a lightning Component to track the current pandemic COVID19 Stats Tracker which shows the current situation of all countries…
Salesforce Quickbooks Integration | eShopSync for Quickbooks
Product Sync? Invoice Sync? And more? eShopSync for Quickbooks brings out the best-class solution for Salesforce Quickbooks Integration. Click on the link to know more:…
4 Salesforce Implementation Challenges Faced by Enterprises
Let's have a look at some of the common challenges enterprises face while implementing Salesforce platform, if you need any help in implementing Salesforce from…