• Ravi G 9
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I have custom object Invoice__c and which is having lookup of account on Invoice_Number__c.
  • Account recordtype is payment and requirement is like whenever this Payment recordtype account is not having any parent account then this Invoice_Number__c ParentId will be blank too.
  • If this Payment recordtype account have parent record then this should be map into this Invoice_Number__c parentId.

I am trying to implement like this and  It is failing and getting null exception.

if(accRec.ParentId != null ){
inv.Invoice_Number__r.parentId = accRec.ParentId;
}
Pls check this and help me on this. Thanks!!
I have custom object Invoice__c and which is having lookup of account on Invoice_Number__c.
  • Account recordtype is payment and requirement is like whenever this Payment recordtype account is not having any parent account then this Invoice_Number__c ParentId will be blank too.
  • If this Payment recordtype account have parent record then this should be map into this Invoice_Number__c parentId.

I am trying to implement like this and  It is failing and getting null exception.

if(accRec.ParentId != null ){
inv.Invoice_Number__r.parentId = accRec.ParentId;
}
Pls check this and help me on this. Thanks!!