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
Suresh RaghuramSuresh Raghuram 

what is the syntax for the following

Public boolean var1{get;set;}

 

In the Controller constructor

 

var1 =ApexPages.CurrentPages.getParameters.get('var1');

 

 

if i declare like this for a boolean parameter it is giving error.

where as for string it is fine.

 

Do any body suggest me how to declare one in the controller

 

ShamilShamil

Try this:

 

var1 = Boolean.valueOf(ApexPages.CurrentPages.getParameters.get('var1'));

 

Suresh RaghuramSuresh Raghuram
I tried and i got this error Visualforce Error
 


System.NullPointerException: Argument 1 cannot be null 

 

External entry point

 

 

ShamilShamil

Seems like ApexPages.CurrentPages.getParameters.get('var1') is null. Check your var1 querystring parameter in the URL.