The tag has no usage guidance.

learn more… | top users | synonyms

3
votes
1answer
32 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
20 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
19 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
42 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
24 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
99 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
47 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
39 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 { ...
1
vote
1answer
76 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
35 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 ...
4
votes
2answers
259 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
44 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 ...
0
votes
1answer
82 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 ...
0
votes
3answers
85 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
120 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
252 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
272 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
251 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
72 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: ...
2
votes
1answer
55 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
128 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
62 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
53 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
78 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
83 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. ...
6
votes
1answer
327 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
86 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
0answers
62 views

Null Pointer Exception due to apex variable in managed package

I have a managed package installed in a customer org. When an exception occurs, I store the line number and stack trace in a custom log record. Is there a way to possibly track down the apex variable ...
0
votes
1answer
145 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
159 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
55 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
269 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
444 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
2k 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
120 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
452 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
53 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
142 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
211 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 ...
1
vote
1answer
152 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: ...
4
votes
1answer
747 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 ...
1
vote
1answer
795 views

System.NullPointerException: Script-thrown exception

I'm trying to create a trigger which updates the Account owner based on the detail object criteria. The account assignment should be in a round robin fashion so that accounts will be distributed ...
2
votes
1answer
615 views

Attempt to de-reference a null object

When I try to load the visualforce page it gives me the error "Attempt to de-reference a null object " I have narrowed it down to the line of code lstNotes.add(new NoteWrapper(lstNotes.size(),new ...
-3
votes
1answer
1k views

System.NullPointerException: Argument cannot be null. in Test Class

At this line I am getting an errror, while running a Test Class, Please suggest solution - public PageReference Save(){ -------code ------ Object__c obj = new Object__c(); ...
1
vote
1answer
42 views

A little help with odd syntax from Twilio gist

I've been testing Twilios's Salesforce integration and after all the hassle that they do not mention in their blog (deploy unmanaged package to sandbox first, add API key to config page that is deeply ...
1
vote
1answer
4k views

System.NullPointerException: Argument cannot be null

Im getting the error 'System.NullPointerException: Argument cannot be null' when I run my test class, in the below test method. /* * update a existing report */ static testMethod void ...
0
votes
1answer
367 views

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

For some reason the variable does not get assigned. What I am trying to do is to pass a set of ids to VF page from a list button. Here's my VF code: <apex:page ...
3
votes
1answer
3k views

Attempt to de-reference a null object: Trigger

There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was: Apex trigger updatequotestatus caused an unexpected exception, ...
2
votes
1answer
283 views

How can I dynamically transverse dynamically SOQL'd SObject fields in Apex?

So, in my other post, I figured out for myself how to dynamically transverse SObject fields in Apex. But within the context of my work, there is a problem with the solution as it currently stands: ...
0
votes
1answer
387 views

Null pointer exception Attempt to de-reference a null object Trigger

I am trying to default the Account Name in a case to 'abc corp' but while executing the code, it gives the error Attempt to de-reference a null object. its happening at line 10 which ...