function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ishan K SharmaIshan K Sharma 

SOQL querry issue

Hi

I am new to salesforce.i need little help with this scenerio

 

I want  to fetch contact record which is highest in organization chart in report to field.

 

My schema is like i have say 3 cont. on same acc. . cont. have a reportsto field(look up-cont) which make an organization chart.

i want to fetch the topmost cont. in org chart through soql.

 

Is there any way to do this or i have to use some other approach...

 

Thanks 

Ishan Sharma

Satish_SFDCSatish_SFDC
What is the Value in the ReportsTo lookup field of the topmost contact? If the top most contact does not report to any other contact, then logically the reports to field should be blank.
In that case you could query on the contacts WHERE ReportsTo is null.

Hope this helps.

Regards,
Satish Kumar
Ishan K SharmaIshan K Sharma
I have done with it.thanks for reply satish.
Satish_SFDCSatish_SFDC

Great.

 

Regards,

Satish Kumar