-
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
Navigating Salesforce Test Automation: A Comprehensive Guide for Engineers
Organizations increasingly rely on advanced tools to keep pace with frequent releases in the rapidly evolving software development world. This blog provides engineers, testers, product…
8 Foolproof Steps to Salesforce Classic to Lightning Migration
Migrating any critical software requires addressing the related complex challenges and preparing a clear roadmap for implementation. As the work environment and resources of every…
Learn All About Data Security in Salesforce
So, as we know in today's business world, data is everything. Nowadays, Companies rely on it to make informed decisions, analyze customer behavior, and stay…
Popular Salesforce Videos
Learn DML Statements in Salesforce Development
In this video, We'll be learning about DML (Data Manipulation Language) in Salesforce development: We will be discussing the following things in this video: 1.…
3 Tips on How To Deliver a Successful Product Launch | Salesforce on Salesforce
Salesforce defines a product launch as announcing a new offering to the public. Launches are an opportunity to tell a compelling story about your product,…
Salesforce Interview With an 11 Year Old Aspiring Salesforce Pro!
In this video, Brad interviews an up-and-coming YouTuber whose content focuses on various topics, including Salesforce. At the age of 11, young Emir has already…