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
JoshTonksJoshTonks 

Controller Extension Help Updating A Specific Field

Hi kind folks,

I am building a quoting system.

I have all the spining up of the information and presenting it to the client thats all working.

what im wanting to do is I currently have a button on each quote option 4 in total which the client clicks. This then wants to update the record with that option being selected so i can set up an internal plain text email alert go from a workflow.

So i have 4 fields Option_1_Selected__c, Option_2_Selected__c, ect.

I have each button as a command button called save1,save2, ect.

I need it to update the corresponding checkbox when clicked so i have written this controller extension but i do not know how to update this one field.
 
public with sharing class UKQuoteExtension {
   
   UKQuote stdCtrl;
   // extension constructor
   public UKQuoteExtension(UKQuote std)
   {
      stdCtrl=std;
   }

   public PageReference save1()
   {
      // stdCtrl.getQuoteOffers();
	  // Option_1_Selected__c = TRUE;
      // Update
      PageReference pr = new PageReference('');
      pr.setRedirect(true);
      return pr;
   }
   public PageReference save2()
   {
      // stdCtrl.getQuoteOffers();
      // Option_2_Selected__c = TRUE;
      // Update
      PageReference pr = new PageReference('');
      pr.setRedirect(true);
      return pr;
   }
   public PageReference save3()
   {
      // stdCtrl.getQuoteOffers();
	  // Option_3_Selected__c = TRUE;
      // Update
      PageReference pr = new PageReference('');
      pr.setRedirect(true);
      return pr;
   }
   public PageReference save4()
   {
      // stdCtrl.getQuoteOffers();
	  // Option_4_Selected__c = TRUE;
      // Update
      PageReference pr = new PageReference('');
      pr.setRedirect(true);
      return pr;
   }
    
}
Im missing something because i need to some how get field from the getQuoteOffers which just returns this record in the controller and then update this field on the record.