Skip to main content
Eager 2 Learn apex's user avatar
Eager 2 Learn apex's user avatar
Eager 2 Learn apex's user avatar
Eager 2 Learn apex
  • Member for 8 years, 2 months
  • Last seen more than 7 years ago
awarded
awarded
awarded
awarded
awarded
comment
Error on testclass: System.NullPointerException: Attempt to de-reference a null object
on line 12 @isTest public class attachPDFTestClass { static testMethod void testAttachments() { Account testAccount = new Account(); testAccount.Name = 'REALIANCE'; insert testAccount; system.debug(testAccount.Id); Facturatie__c currentRecord = new Facturatie__c(); currentRecord.Accountname__r.Name = testAccount.Name; system.debug('testAccount debug'+ testAccount.Name); insert currentRecord;
comment
Error on testclass: System.NullPointerException: Attempt to de-reference a null object
Still get same error on line 12: @isTest public class attachPDFTestClass { static testMethod void testAttachments() { Account testAccount = new Account(); testAccount.Name = 'REALIANCE'; insert testAccount; system.debug(testAccount.Id); Facturatie__c currentRecord = new Facturatie__c(); currentRecord.Accountname__r.Name = testAccount.Name; system.debug('testAccount debug'+ testAccount.Name); insert currentRecord;
comment
Error on testclass: System.NullPointerException: Attempt to de-reference a null object
The system.debug(testAccount.Name); is ok, so this part works fine. The error comes from the testFactuur i think as system.debug('line 3'); system.debug(testAccount.Name); both work except for system.debug('line 4');
Loading…
answered
Loading…
asked
Loading…
comment
Help writing a testclass for controller extention so far i have the following:
In the testclass line 5 Facturatie__c a = new Facturatie....
Loading…
accepted
accepted
Loading…