I have a controller where I have this code. I need to pass BooleanVariableName to another controller
PageReference pageRef = new PageReference('/apex/ContactV1?id=' + contact.Id);
pageRef.getParameters().put('BooleanVariableName', 'true');
pageRef.setRedirect(true);
return pageRef;
In second controller, I put the following code to get the value for BooleanVariableName. This controller is the conroller for page ContactV1
Boolean PBV = system.CurrentPageReference().GetParameters().get('BooleanVariableName');
When I tried to save it it gave me the following error. Error: Compile Error: Illegal assignment from String to Boolean
Please help.Thanks in advance