function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ckellieckellie 

Dynamic Picklist Error

I have created the following dynamic picklist.
for(firepond__Configurable__c prod : [select id, name, firepond__Item_Id__r.name, firepond__Item_Id__c, firepond__Item_Id__r.Salesforce_Product__r.name, firepond__Item_Id__r.Salesforce_Product__r.id, firepond__Item_Id__r.firepond__Description__c, 
                                                                firepond__RecordType__c from firepond__Configurable__c where firepond__RecordType__c = 'Product'
                                                                and firepond__Item_Id__c<>'' and (Not firepond__Item_Id__r.name like '%Veryx%')]) {
                    
                    productNamesMap.put(prod.Id, prod.firepond__Item_Id__r.firepond__Description__c);
                    productIdsMap.put(prod.firepond__Item_Id__r.firepond__Description__c, prod.Id);
                    FPXProd.add(prod.firepond__Item_Id__r.Salesforce_Product__r.name);
                        }             
                    if(productNamesMap != null){
                    productNamesList = productNamesMap.values();
                    }

        for(Product2 prod : [ select id, name from product2 where not(name =:FPXprod)]){
                    productNamesList.add(prod.name);
                    produc
The end user can filter this picklist by typing keywords in the text field. If the end user selects a value without filtering the picklist, the system will not return the currect selected value. But if the user filters the picklist to a few values, they will recieve the selected value. Why does the size of the picklist affects whether the system will return the value the user selects?

Thanks,
ckellie
 
Best Answer chosen by ckellie
doravmondoravmon
Using query in a for loop is really a bad idea...it will be over the limit easily.

All Answers

doravmondoravmon
Using query in a for loop is really a bad idea...it will be over the limit easily.
This was selected as the best answer
ckellieckellie
This solved my question Thank you
doravmondoravmon
np~~^_^