You need to sign in to do that
Don't have an account?
swapna muthiyalu
select field,oldvalue,newvalue,contactid, contact.name,account.name FROM contacthistory . i tried this query to fetch account name without using nested query, but throwing error.please help
i want to fetch account name from this query.
You can do some think like this
1 . Create a formual field on contact that will return the name of account
Formual : Account.Name
2. Use this SOQL as shown below
contact.Acc_Name__c is formula
(a)-IF contacthistory is the child of both Account and Contact. You can query without nested query.
(b)-IF contacthistory is the custom object you can use contacthistory__c.
Please check below url to understand Prent to child query and Child to Parent query.
1- https://salesforce.stackexchange.com/questions/127838/how-to-query-child-to-parent
2- https://developer.salesforce.com/forums/?id=9060G000000XbH5QAK
3- https://salesforce.stackexchange.com/questions/17916/child-to-parent-query-object-object-is-the-result
Please let me know if you have any query.
Please mark it as best Answer if you find it helpful.
Thank You
Ajay Dubedi