-
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
Salesforce and Gmail Integration | The Perfect Integration Guide
Salesforce Gmail Integration Gmail is a free Web-based Mail service that provides users with gigabytes of storage for emails and information and provides the ability…
Steps to Send a Marketing Cloud Email by using Triggered Sends in Sales Cloud
Steps to send a Marketing cloud Email by using Triggered send in sales cloud Note - First you have to enable the Triggered send in…
Learn All About Flows and Plugins in Salesforce | The Developer Guide
Flows When the process involves the number of pages when the data need to be transferred between the pages. We prefer to uses flows. Plugin…
Popular Salesforce Videos
Why There Are So Many Acquisitions in The Salesforce Ecosystem?
Global technology acquisition deals amounted to $634.1 billion in 2020, an increase of 91.8% year-on-year. An acquisition is when one company purchases most or all…
Winter '21 Release | Salesforce Tutorial Video
The Sandbox Preview window for Winter '21 begun on September 11, 2020. You must have an active sandbox on a preview instance before then to…
How To Assign Leads in Salesforce | Overview of 3 Main Lead Routing Solutions
Salesforce offers several options on how to automatically assign incoming leads to a suitable sales manager. But what to choose: out-of-the-box features, external AppExchange app,…