0
 @RemoteAction
public static void saveActivitySettings(){

    public String selectedStage {get;set;}
    public Boolean isLeadConverted {get;set;}

}

Why it is throwing following error for getter setter :

Compile Error: expecting a semi-colon, found '{'

1
  • Is isLeadConverted referred any where in this method?
    – Reshma
    Feb 21, 2017 at 8:15

1 Answer 1

3

You can't declare global variable inside a method. Move the public String selectedStage {get;set;}, public Boolean isLeadConverted {get;set;} to class level.

public class VFRemoteTestingPage {
    public String selectedStage {get;set;}
    public Boolean isLeadConverted {get;set;}

    @RemoteAction
    public static void saveActivitySettings(){
        //Your logic
    }
}
4
  • now its throwing : Variable does not exist: isLeadConverted
    – user40665
    Feb 21, 2017 at 7:34
  • It wont throw any error if you try to save the above class
    – prasanth
    Feb 21, 2017 at 7:43
  • @user40665 If possible can you please post the entire class code.
    – Saroj Bera
    Feb 21, 2017 at 8:21
  • I have changed the variables to static.. now its ok
    – user40665
    Feb 21, 2017 at 8:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .