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

how to retrieve a picklist value?

Hello all,

I'm trying to retrieve the picklist value of  different quoteLines using a query and then set a field to "Yes" in case there is at list one picklist value equals to "Service & Other".

Product_Family__c is the picklist field.

the problem is that records[i] holds more data than the picklist value itself.

var soql = "select Product_Family__c  from SFDC_520_QuoteLine__c where Quote__c = '{!SFDC_520_Quote__c.Id}'";
var queryResult = sforceClient.Query(soql);

var records = queryResult.records;
var flag = true;
for(var i=0;i<records.length&&flag;i++)
 if(records[i]=="Service & Other")
  flag = false;

how can I get the picklist value itself?

Thank you all.


Message Edited by Assaf on 09-10-2008 11:38 PM
See the following article "Getting Picklist Values" that may help you.
Thanks for replying.

unfortunately, the link wasn't that helpful.

the issue is that for each  Object I want to retrieve its picklist value assigned.

the query returns its the pick list value but it returns it with more details( it look like hash or something) and not just the value "Service & Other".

I tried to retrieve it in many ways but didn't find a solution yet.

please help.

Thank you all.