You need to sign in to do that
Don't have an account?
Keenan Wojnicz
Keep getting a null object error, I don't understand!
Hi,
I'm trying to deploy a new visualforce page but I keep getting this error, I don't understand why it's happening.
I am in dire need of some assistance!
The error says:
Apex script unhandled exception by user/organization: 00537000000iFK0/00D210000000MSY
Source organization: 00D37000000Pn3O (null)
Visualforce Page: /apex/BusinessIssue
caused by: System.NullPointerException: Attempt to de-reference a null object
Class.BusinessIssueController.<init>: line 20, column 1
I'm trying to deploy a new visualforce page but I keep getting this error, I don't understand why it's happening.
I am in dire need of some assistance!
The error says:
Apex script unhandled exception by user/organization: 00537000000iFK0/00D210000000MSY
Source organization: 00D37000000Pn3O (null)
Visualforce Page: /apex/BusinessIssue
caused by: System.NullPointerException: Attempt to de-reference a null object
Class.BusinessIssueController.<init>: line 20, column 1
<apex:page standardController="CriticalBusinessIssue__c" extensions="BusinessIssueController" tabStyle="CriticalBusinessIssue__c"> <style> .startStyle{ font-size:12px; font-weight:bold; color:red; } </style> <apex:sectionHeader title="Business Issue" subtitle="Critical Business Issue" /> <apex:form id="frm"> <apex:actionFunction name="addIssue" action="{!AddIssue}" status="addBI" reRender="frm" /> <apex:pageMessages escape="false" /> <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton value="Save Business Issues" action="{!Save}"/> </apex:pageBlockButtons> <apex:pageBlockSection title="New Critical Business Issue" columns="1"> <apex:actionStatus id="addBI" startText="Adding..." startStyleClass="startStyle"/> <apex:pageBlockTable value="{!BusinessIssueModels}" var="bim"> <apex:column headerValue="Sr. No." value="{!bim.srNo}" /> <apex:column headerValue="Critical Business Issue"> <apex:inputField value="{!bim.businessIssue.Body__c}" style="width:500px;"/> </apex:column> </apex:pageBlockTable> </apex:pageBlockSection> <apex:commandButton value="Add More Business Issues" onclick="addIssue(); return false;" /> </apex:pageBlock> <center></center> </apex:form> </apex:page>
I dont understand why the error is coming.
It would be good if you can contact me personally on my gmail Id or Skype so that i can look at your issue in a better way and will surely provide you help.
Gmail : abhibansal2790@gmail.com
SkypeId : abhishek.bansal2790
Let me know if you have any other way in which i can provide you help.
Thanks,
Abhishek
All Answers
I used the code you provided for the BusinessIssueController but I'm still getting the null object error.
Any other ideas on what the problem could be?
I have done some modification in your controller class.
Please try with the below updated code :
Let me know if you still have any issue with this.
Thanks,
Abhishek Bansal.
Thanks for your response, when I used the code you provided for the BusinessIssueController I received:
Compile Error: Type cannot be constructed: Integer at line 75 column 20
I tried removing lines 74-76 but when I tried to preview my visualforce page I received the same null reference error.
Thanks,
Keenan
I have update your code and it will work fine.
Please try with below code :
Please let me know if you still have any issue.
Thanks,
Abhishek Bansal.
I was able to use the code for this controller but I'm still getting the de-reference a null object error.
Do you think the problem could be coming from my Visualforce page code that I referenced at the top? Or do you think the issue is in the controller code?
I'm just very confused as to why this is happening. I've used this code before In a different instance of SalesForce without any problems like this, but for some reason it's not working now..
Thanks,
Keenan
I dont understand why the error is coming.
It would be good if you can contact me personally on my gmail Id or Skype so that i can look at your issue in a better way and will surely provide you help.
Gmail : abhibansal2790@gmail.com
SkypeId : abhishek.bansal2790
Let me know if you have any other way in which i can provide you help.
Thanks,
Abhishek