You need to sign in to do that
Don't have an account?
Nitin tronixdev
Unable to Fetch Account Lookup Field In Contact Value From Other Object
Hello,
I have a object in which a lookup field connected to Contact standard object .
for e.x.
field name is emp__c i.e.. lookup datatype
when i write emp__r.Phone in sql query i got phone number from contact object of a particular employee
similary when i write emp__r.Site__c i got all site's value from contact object of a particular employee
but
when i try to fecth account from contact object i got null value like:-
emp__r.Account
to check my query i also created a custom lookup field in contact which is connected to account
when i write
emp__r.Acc__c...
Still i get null values..
why??
Its very urgent pls reply ASAP.
I can fecth any other value from contact using relation field other than account only ...
but i want account from contact object
I have a object in which a lookup field connected to Contact standard object .
for e.x.
field name is emp__c i.e.. lookup datatype
when i write emp__r.Phone in sql query i got phone number from contact object of a particular employee
similary when i write emp__r.Site__c i got all site's value from contact object of a particular employee
but
when i try to fecth account from contact object i got null value like:-
emp__r.Account
to check my query i also created a custom lookup field in contact which is connected to account
when i write
emp__r.Acc__c...
Still i get null values..
why??
Its very urgent pls reply ASAP.
I can fecth any other value from contact using relation field other than account only ...
but i want account from contact object
Please try this :
emp__r.AccountId
This is the correct syntax for using Account field from contact.
Thanks,
Abhishek.
when i fecth site__c from account i wrote emp__r.site__c
but for account why i need to write emp__r.Account.Name
So the correct way would be emp__r.Account. <your field>
Also, as a best pratice you can mark the best answer in the post so that it will be helpful for other developers who comes across it.