The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
3answers
42 views

System.NullPointerException: Attempt to de-reference a null object on After Insert trigger

I've written an Apex class to update a field based on valued in a custom setting. However, I get the following error when I run the test class: System.DmlException: Insert failed. First exception ...
0
votes
3answers
38 views

Intentionally blank field causing System.NullPointerException: Attempt to de-reference a null object

My company has a custom, multi-select picklist field for adding contacts to various campaigns. If a value is de-selected(unselected?) from that field they'd like the contact automatically removed from ...
2
votes
1answer
40 views

Apex Rest Wrapper - Error Attempt to de-reference a null object

So I've done quite a bit of searching on the forum and am learning a ton. I really appreciate the experts on this forum who are willing to help out. I am taking inspiration/following the code posted ...
0
votes
1answer
28 views

Attempt to de-reference a null object - Error in sorting list

I am getting subject line - error while I try to execute below apex code snippet Apex Code Snippet for(Integer index = 0; index < surveyInstanceList.size(); index++) { Survey_Question_vod__c ...
1
vote
1answer
36 views

Nullpointer exception

I have a controller as below <apex:page controller="SampleController"> <apex:form > <apex:pageblock > <apex:pageBlockSection > <apex:...
0
votes
1answer
37 views

System.NullPointerException: Argument 2 cannot be null

I am attempting to handle exceptions within the context of using a custom object that we have to display error messages. I want to capture any exception or dmlexception messages and use them in the ...
1
vote
2answers
57 views

Argument 1 Cannot be Null in For Loop

I have the below method that populates a selectlist on a VF page: User u = [SELECT Id, ContactId, FirstName FROM User WHERE Id = :UserInfo.getUserId()]; Contact c = [SELECT Id, LastName, ...
0
votes
1answer
46 views

Help with Test Class: System.NullPointerException: Attempt to de-reference a null object

My apex consists of an trigger and an apex class. My test class continues to fail with System.NullPointerException: Attempt to de-reference a null object Trigger: trigger PQ_Update on ProdQueue__c (...
-1
votes
3answers
35 views

“update object.relatedObject__r” caused “Attempt to de-reference a null object” error in Unit Test

The code is working. Just to make it in Production, I need to do proper unit test to make sure the code coverage is above 75%. In the Controller Extension, I made a simple Page Reference to save the ...
0
votes
1answer
52 views

Attempt to dereference null object error

I have below controller where I get Attempt to dereference a null object error at ProdIds.add(c.id); Line. Error Code public TestController(ApexPages.StandardController stdCtrl) { ...
3
votes
1answer
42 views

NullPointerException in a trigger framework

I'm trying to adapt to Tony Scott's tidy trigger pattern. I'm trying to prevent users from uploading more than certain size of attachments. I have written the Handler class for Attachment object and ...
0
votes
0answers
28 views

Salesforce Test Execution Zendesk error

I've tried to execute the following test method: static testMethod void testLeadStatusExistingDeal() { Test.startTest(); Lead record = new Lead(LastName = 'Dimitrov', Company ='NewLead1', ...
0
votes
1answer
44 views

NullPointerException when running unit test

I have a class that I have been running without any issues. I've created a test class to get a bit of code coverage for it and the test is failing when the constructor is called. Without going into ...
0
votes
1answer
48 views

Custom Calendar - de-reference a null object - PRODUCTION

I'm running into an interesting issue, in production. I'm building a custom calendar, which the code was taken from open source Ross Heuss. I've made some tweaks and such, in sandbox it works ...
0
votes
1answer
72 views

Null pointer exception in trigger.oldmap

I'm brand new at SF development but here's what I'm trying to do. I have a property custom object and it has some basic fields (Address, City, State, Zip). I have a Leasing Invoice custom object as ...
0
votes
3answers
370 views

System.DmlException: Insert failed. First exception on row 0; first error:

I have the error message above, but I am not sure, what else to take care of. My Code is the following and the error is in a test class My Code: trigger AddAccEuroAISNo on Task (before insert, ...
1
vote
1answer
66 views

CampaignMember.getSobjectType() returning null

Whenever i am calling CampaignMember.getSobjectType() method , getting nullpointer exception. I tried to debug the CampaignMember object but getting null value object as well. Marketing User checkbox ...
0
votes
1answer
59 views

NullPointer Exception at Boolean value assign

Please find below class where I get Null Pointer Exception while assigning value to boolean. Please let me know where is my fault here? Thanks! Apex Class: public class CallReplica_controller { ...
2
votes
1answer
141 views

Trigger Null pointer exception

I have this trigger that errors out at line 13 NullPointerException attempt to de-reference a null object in Apex Trigger Code trigger Event_Attendee_vod on Event_Attendee_vod__c (before update, ...
4
votes
2answers
46 views

Failing test is showing as passed

In Debug Logs I can see a System.NullPointerException for the unit test that was just run, but on the Apex Test Execution page I see the test as passing. The error is not buried within the log details;...
4
votes
2answers
385 views

Null Pointer Exception add AccountId to WhatId for Task

Trying to build what I thought would be a simple trigger: when a task is created that is only related to a contact (WhoId = contact type, but WhatId = null), relate the task's WhatId to the contact's ...
0
votes
1answer
46 views

I am getting a null pointer exception with this line of code: cse.opportunity__r.id = opp.opportunityid; cse.account.id = opp.opportunity.accountid;

I am trying to set the created case account to the opportunitylineitem.opportunity.account and the opportunity__c (lookup on opportunity) to the opportunitylineitem.opportunity. I am getting a null-...
1
vote
1answer
121 views

Calling JSON.deserialize() throws “System.NullPointerException: Attempt to de-reference a null object”

I'm trying to use the System method JSON.deserialize(jsonString, apexType) to deserialize the body of an ApexRest POST request. My code compiles, but at runtime I'm getting a System....
0
votes
3answers
103 views

Test Class doesn't push values into a trigger; Getting: System.NullPointerException: Attempt to de-reference a null object

I have trigger that on deployment is throwing a NullPointerException. The error is: Trigger.tgr_send_enrollment: line 13, column 1: [] System.DmlException: Insert failed. First exception ...
1
vote
1answer
182 views

NullPointerException; why am I getting this?

I am at a loss as to why this trigger is throwing up a NullPointerException... it isn't clear to me, as I am querying for the OwnerId before I loop through my inserted tasks. The error message is as ...
1
vote
2answers
352 views

Attempt to de-reference a null object in trigger to create child object upon field change

I have created a trigger on the Project custom object, to create a record in the Project Note custom object when the description field is modified. Running the unit test however, I receive the ...
3
votes
2answers
394 views

Why is this Apex Trigger throwing a Null Pointer Exception: Argument cannot be null?

This trigger references blank fields, and complex formula fields. The reason I'm trying to do a trigger and not a formula is that it resolves to too many characters because of referenced formula ...
3
votes
1answer
308 views

NULL lookup field in Test Class

I'm getting a null value on a lookup field when running a test class. Account a = new Account(Name = '1', Owner = u, CurrencyIsoCode = 'CAD'); insert a; a = [SELECT id, AccountNumber, Name, ...
2
votes
1answer
77 views

Using rendered=“” parameter causes checkbox to evaluate to null

Putting checkbox inside outputpanel or using rendered on itself, will display correctly, but will cause null de-reference when its used in the class. What is the reason behind? This works: <apex:...
2
votes
1answer
90 views

NULL POINT Exception

I am getting NULL POINT Exception error when running my unit tests and can't seem to figure out how to go about this one. This is the error Message; |FATAL_ERROR|System.DmlException: Insert ...
1
vote
1answer
130 views

Attempt to De-Reference a null object won't except data

I have an issue when I try to input data into a custom object. On line 14 is where I'm getting the NullPointer. System.debug(testAccount[0].name) outputs an account name created in line 8. But when ...
1
vote
1answer
75 views

System.NullPointerException Error for new method to be deployed through Change Set

I have added a new method in a class and added test data in the test class . It was PASS when I Ran the test class in Sandbox. However , when I'm trying to deploy in Prod through Change Set, It's ...
0
votes
0answers
55 views

System.NullPointerException: Attempt to de-reference a null object - VF Page Error

I am getting the error on click of button in VF Page. In the controller , we are getting data from one object and grouping and performing some arithmetic operations and creating records. In the ...
0
votes
2answers
103 views

Attempt to de-reference a null object - Delete

I am getting Attempt to de-reference a null object at below when del() method is called. Can anyone point out what has went wrong : public class DeletingCheckedRowsController { public ...
0
votes
1answer
90 views

System.NullPointerException: Attempt to de-reference a null object - VF Page

I am getting the mentioned error in the following line: map1.get(PAPC.Country__c).Q1__c += (PAPC.Q1FX__c == null ? 0.0 : PAPC.Q1FX__c); Baically it's assigning value from one object to the other. ...
7
votes
1answer
431 views

Force Dynamic Soql results to include fields with null value

So I've read a lot about this and it seems that queries run with Database.query(queryString) will skip over any field values set to null instead of returning the property set to null This has cause a ...
0
votes
2answers
106 views

Substring is getting nullpointer exception

I have a map of contacts. Need to print substring of title. but it errors out, when title is null : System.NullPointerException: Attempt to de-reference a null object public class k { public ...
0
votes
1answer
189 views

Trigger causing NullPointerException only through Data Loader

I've developed a trigger to run if an Account owner changes, and based on the profile of who it changes to, update upcoming events titled "Welcome Call" to match the account owner. This runs fine for ...
1
vote
1answer
196 views

Trigger Error - Attempt to de-reference Null Object

I'm trying to create a trigger class that will clone an Opportunity that is of a certain record type and reaches a Stage that contains Close Won. Everything saves fine, but when I try to close out an ...
1
vote
2answers
61 views

NullPointerException on Insert

I'm not sure how to write this, but I know what the issue is. The following can be triggered by Insert or Update. Below, mapOfEnroll is Trigger.oldMap. I know the mapOfEnroll value is null on Insert ...
0
votes
2answers
355 views

Null Pointer exception

I have below generic class, whose methods are called from an Account before insert , before update trigger. Below class is getting a Null Pointer exception for any Account at commented line. Can ...
0
votes
1answer
875 views

Logical Help needed - FATAL_ERROR|System.NullPointerException: Argument cannot be null

I have List of Employee's, Now Want to create my ThirdObject record if Condition 1) objEmp.Location__c ==null as well as If Condition 2) objEmp.Location contain in objSecondObject.SecondLocation__c ...
0
votes
3answers
3k views

Visualforce Error: Attempt to dereference a null object

Error comes at line 23. Line 23 is mentioned below as a code comment. I also tried by commenting this line and still error is there. But at line 24 which is upsert(Event); Controller public with ...
0
votes
1answer
159 views

Broken Parent Rollup trigger: System.NullPointerException: Attempt to de-reference a null object on trigger

I'm getting the following error when attempting to mass update accounts via Data Loader. The id throwing the error is the same in each instance. The Trigger (listed below) is meant to aggregate field ...
0
votes
1answer
519 views

Access user creating a record in before insert trigger

I'm trying to set some default values for contact fields based on which user is inserting the record into the database, but am coming up against a NullPointerException as the CreatedById is null ...
0
votes
0answers
55 views

Trigger causes Null Pointer Exception

I have created a trigger, and when I test it in my application, I get the following error: CreatePolicy: execution of AfterUpdate caused by: System.NullPointerException: Attempt to de-reference a ...
1
vote
1answer
167 views

Static list property returning null

I've built a property to setup test data within my test class, but my tests keep throwing 'Attempt to de-reference a null object' errors. I've been able to narrow it down to this property. I'm finding ...
0
votes
2answers
247 views

System.NullPointerException: Attempt to de-reference a null object class

Can anyone help me in changing this query. public void ReAssignTask(List<Task> taskList){ //Initialize variables String tempContainer; Set<Id> taskOwners = new Set<Id>()...
1
vote
1answer
185 views

De-Reference a Null Object

I'm a new admin in an org that has had some custom development done in the past and our code coverage has fallen below 75%. In one of our Apex Test Classes, we get an error that states: System....
4
votes
1answer
907 views

Why does this call to Trigger keySet() throw a null pointer exception?

I have a simple trigger like: trigger littleTrigger on Custom__c (before insert) { Set<Id> idSet = Trigger.newMap.keySet(); //Some stuff } Why could the second line throw a null ...