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
moeoomoeoo 

select available value from custom pick list field

Hi
 
I have a custom pick list field and I want to select all the availble values by query satement.
 
Does anyone have an idea how the query string will look like?
 
I have AccountStatus field and values are Active, Inactive, etc.
 
Thanks
MigMig
Hi,
I've got the same problem, I'd like to get all the available values from a pick list. Is it impossible to do it by query statement ( if it is, how ? ).

Otherwise, Is it possible by using the DescribeSobject ?
    By :
    1. Pick up all the fields and then check and save the picklist I want.
    2. Get the values from that picklist.

I'm trying to do it by this way but I'm not suceeding. Can someone help me please ?

 It's quite important ! So thankyou all ...

Regards

Mig


Ron HessRon Hess
you must use describeSobject to get the picklist values.

if you are using this method, what is not working?
the describe call or looping thru the fields?
 
MigMig
Done. Not very hard finally, I had some troubles with the way to do it! There is unfourtunely not enough examples. It's important to understand how the describe SObject works ...
Thankyou Ron for the Reply.


Best regards
Mig
moeoomoeoo

Hi all

Thanks for replying.

I would like to get the pick list in sControl. Can I use the DescribeSobject in s-Control/Javascript? If so how? Can anyone give me some example code?

Thanks

Moe

sekoulinuxsekoulinux
Hi
 
I need help on the above also.
 
I am using an s-control and want to create a picklist with values of the pricebook products.
I want this picklist to display in the Opportunity add product page.
 
Is this possible?
 
Thanks in advance
 
Harnek
MigMig

 

Hi

sekoulinux yes U can ... well if I understand want u want ..; U have the possibility to access to all the Objects ir your sfdc !! And offcourse all the fields ...

Code:
result = sforce.connection.describeSObjects(["Product2","Opportunity"]) ;

var length = result[1].fields[yourpicklistfield].picklistValues.length ;

for(var i=0; i < length ; i++) {

var o=new Option(result[1].fields[yourpicklistfield].picklistValues[i].label, result[1].fields[yourpicklistfield].picklistValues[i].name);

... // save the data into the selects types with the new option o !! 
}

 

... Something like that


 yourpicklistfield is the Index of the picklist field u want to know the values.

Message Edited by Mig on 09-20-2007 11:58 PM

Message Edited by Mig on 09-21-2007 12:01 AM

Message Edited by Mig on 09-21-2007 12:01 AM

sekoulinuxsekoulinux
Hi
 
How can i get the id of my custom field, which i have added to the opp product page?
 
Thanks
Harnek
sekoulinuxsekoulinux
sorry i meant index
sekoulinuxsekoulinux
thats sorted
 
but...how do i add say options to a picklist/select that will be displayed on the page e.g.
custome field = products on the opp prod page
 
i have my products from the db
i used:
 
var o = new Option("test","test")
 
now how do i add this to the picklist and update its values
 
 
thanks