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
AnnieGAnnieG 

After the LeadSource picklist value is updated

Hi,
        I have a Scontrol that updates a lead's LeadSource picklist value at the click of a button. The function is as follows:
        function changeLeadStatus() {
                var lead = new Sforce.Dynabean("lead");

                var list = document.getElementById("select1");

                lead.set("id", list.options[list.selectedIndex].value);

                lead.set("leadSource", "Lead Assigned");

                var saveResult = sforceClient.update([lead]);

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

                         if (saveResult[i].success == true) {

                               alert("Yay!! I updated the lead souce successfully: " + saveResult[i].Id);

                         } else {

                          alert("Rats!  There was a problem and I think the problem is: " +                                  saveResult[i].errors[0].message);

                        }
                  }
      }

           The code runs just fine, after execution, I checked the Lead table via the appexchange plugin for eclipse, and could see the LeadSource field is indeed updated. But when I checked the lead information at saleforce.com, the leadSource field value just doesn't reflect the change.
           What is happening? Thanks for your input!
AnnieGAnnieG
Never mind, seems it is picking up the change now. Thanks!