• Rick Culbreth 11
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I have a lightning Component on an object related to account. I am trying to get the account owner information to take different action based off owner.  I have tried several things but they all come back as undefined.  the lookup field on the custom object to account is called Practice_Provider.  Just wondering what the correct path, I can use ID or Name to do what I need.

Some of the code I have tried, all say undefined:
Window.alert('Account 1 Ownerid ' +               component.get('v.sObjectInfo.Practice_Provider__r.OwnerId')) 
         window.alert('Account 2 Owner.Id ' + component.get('v.sObjectInfo.Account.Owner.Id')) 
         window.alert('Account 3 Owner.Id ' + component.get('v.sObjectInfo.Practice_Provider__r.Owner.Id')) 
         window.alert('Account 3 Owner.Id ' + component.get('v.sObjectInfo.Account.OwnerId')) 
        window.alert('Sobject OwnerId ' + component.get('v.sObjectInfo.ownerId')) 
         window.alert('Sobject OwnerId ' + component.get('v.sObjectInfo.OwnerId')) 
        window.alert('Account Owner Name ' + component.get('v.sObjectInfo.Practive_Provider__r.Owner.Name')  )   
       
 if (''+component.get('v.sObjectInfo.Account.Business_Partner_Identifier_Code__c')+'' == 'FL')   ----- This part works it returns value in Account Field.