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
ncix007ncix007 

Updating picklist value from custom S-control

hello everyone,
I want help for the updating picklist value from s-control
In my s-control I am showing list of 10 user  with selected picklist value for each user and if i changed  picklist value of anyone and have to save
it.

I have shown all the user and their picklist value and  i changed picklist value  of any one of them.now i have to save them  what  should i do?
how can i save each changes value of the picklist .

plz help me :)

regards
nirmal

michaelforcemichaelforce

nirmal,

I'm unclear here...are you asking how you update the value of a field which is a picklist?  Or asking how to actually change the values available in a picklist?

sekoulinuxsekoulinux

Hi

This is pretty urgent so please help.

I have a custom picklist field on my opp product page and need to populate that with products.

I have created a query, which retrieves the product names:

 var result = sforce.connection.query("Select Name from Product2 where Name like \'Extra%\' ");

I am able to get the picklist field:

 var fieldres = sforce.connection.describeSObjects(["OpportunityLineItem"]) ;

 var picklistVal = fieldres[0].fields[50];
 var picklistValues = picklistVal.getArray("picklistValues");

Now i need to add the new products where label and value = productname, to this custom picklist.

I can create a new option:

var o = new Option("prod","prod");

But how do i put this new label/value back into the picklist array and then update the salesforce picklist.

The picklist is on an opportunitylineitem. At first i had tried this for testing:

OpportunityLineItem = new sforce.SObject("OpportunityLineItem");
// Populate the ID field for the update call. 
OpportunityLineItem["id"] = "00k20000002X???"

OpportunityLineItem["Products__c"] = "prod"; 
sforce.connection.update([OpportunityLineItem])

But hit a problem when trying to add other values.

 

Thanks

Harnek