0

I am trying insert a parameter into the record that already exists and then put in the save method in an apex controller extension for a standard controller. This is the controller extension pretty basic at the moment. I have a page on hosted on a Salesforce sites. If anyone could advise me on this i will be very grateful.

I have a parameter in the URL that comes to this page of PSC. www.theurl.com?id=00000000000000&PSC=1

public with sharing class CSATExtension
    {    
       ApexPages.StandardController stdCtrl;
       // extension constructor
       public CSATExtension(ApexPages.StandardController std)
       {
          stdCtrl=std;
       }

       public PageReference save()
       {
          stdCtrl.save();
          PageReference pr = new PageReference('http://www.ramtracking.com/thankyou');
          pr.setRedirect(true);
          return pr;
       }
    }

Do i need to set it like this

public integer PSC {get;Set;}

Or would i need to use something like this

public integer PSC = apexpages.currentpage().getparameters().get('PSC');

I somehow think it needs to be both because im trying to dynamically render elements of the page based on PSC parameter so if it equals 1 then it will render this and if it is 2 it renders these elements. I am then trying to add this to update a field in the standard controller on the stdCtrl.save().

This is the first question I've posted on here so please tell me if I've posted it incorrectly.

Thanks for your time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.