+ Start a Discussion
Siva SakthiSiva Sakthi 

Change the Picklist values when we click a link or button?

I want to change the pick list value (Open,Inprogress,Hold,Complete) the default value is open . when i click a button or link  ask one meaasge are you sure want to complete? Y/N, click Y means,  the picklist value to change (open to complete), also enable the check box is true.?


Any suggestion is helpful..



if you do this in a custom VF page then you can use onclick java script to confirm the request and then perform the action and set the picklist value to 'Complete' and set true in checkbox  like:


<apex:commandbutton value="Complete" action="{!doComplete}" onclick="return doConfirm();"/>


      function doConfirm() {

              var r=confirm("are you sure want to complete? Y/N");

             if (r==true)   {
               return true;
            } else  {
                   return false;




And in Apex.

public void doComplete() {

     //set the value here.




please let me know if u have any problem on same and if this post helps u plz give KUDOS by click on star at left.

Siva SakthiSiva Sakthi



Send what type of value pasted in the apex controller.? I got  a error. When i click the popup window ok , the status field is update open to complete, also one check box complete is true?


 Listcontrol Compile Error:    Variable does not exist: Status__c at line 9 column 17


public void doComplete()


     if(Status__c == 'Open')
         return Status__c = 'Complete';
        return Question_Set__c = true;
        //return null;




Is there a way we want the user to select and then update the records?
Admin 123Admin 123
I have a standard link of a standard button, So I copied this link and used for my custom button in order to have the same functionality. but I want my link to set different default picklist value? However, I have created on click javascript functionity.