You need to sign in to do that
Don't have an account?
persistent 129
System.VisualforceException: Attempt to de-reference a null object in Page.getContent
Hi,
My Code bolow,
PageReference pr = Page.VF_Page_Here;
String mailBody = pr.getContent().toString();
The above code was working fine abount a few day's ago. All of a sudden it has started throwing exception,
System.VisualforceException: Attempt to de-reference a null object
When I run the same code through workbench it works fine, but when called from an apex class throws the above excpetion.
Has somebody faced similar issue & got any resolution over it?
Is this some versioning problem?
Please help!!
Thanks in Advance!
My Code bolow,
PageReference pr = Page.VF_Page_Here;
String mailBody = pr.getContent().toString();
The above code was working fine abount a few day's ago. All of a sudden it has started throwing exception,
System.VisualforceException: Attempt to de-reference a null object
When I run the same code through workbench it works fine, but when called from an apex class throws the above excpetion.
Has somebody faced similar issue & got any resolution over it?
Is this some versioning problem?
Please help!!
Thanks in Advance!
VF_Page_Here.page
SampleController.cls
When I directly run this page, by passing query parameters, it is woking fine. But when accessed as below throws the exception,
salObj.First_Name__c
salObj.Middle_name__c
salObj.Last_Name__c
Let us know if this will help you
Yes, the fields are not empty.
When I run the same code from workbench it does work wihout any error, but when called from another Controller method facing the error!