SQL Query? Creating a list of contacts based on Account fields - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Terry ClineTerry Cline 

SQL Query? Creating a list of contacts based on Account fields

Hello - I need to generate a list of "contacts", based on information in their Account records - a standard SQL type query.

Example: I need a list of all Contacts who are linked to Accounts where the Account Industry field has a value of "ABC". (I have other critieria I would like to use, but this example will get me to the right place to generate the query.) it's a classic parent-child  type query.

I could write this in SQL easily enough, but I don't know where or how I can create and run a query like this. I can't seem to use the existing filter system on my Salesforce dashboards, as it doesn't appear to support multi-table links. CORRECT ME IF I AM WRONG, please!!

I need to then be able to export this list of Contacts that resulted from the query.

Do I need to become a "developer" to get this kind of reporting/Query functionality?

Is there a tool I am not seeing that supports an ability to create a standard query against the tables?

I know Salesforce has it's own SQL like language (SOQL?) but I don't understand where/how to get at it.



Mark PassovoyMark Passovoy
My favorite SOQL application is the Force.com Explorer which allows you to write and execute your own queries and see the results:


I would also look into the standard report engine again. I do think that you should be able to get to the Account fields when creating a Contact report. The report engine does not allow for SQL like commands but is good for end user purposes which it sounds like you may need something above and beyond.

Terry ClineTerry Cline

But the developer Explorer is not letting me logon. We use the Enterprise Version of SF - am I out of luck? Am I going to need the Developer or Production version? If so, that could be a show stopper.


Mark PassovoyMark Passovoy
You can use the Force.com Explorer with all Editions that can use the API (Enterprise, Unlimited, Enterprise Sandbox, Developer Edition). If it is not letting you log in, you may need to use your security token with your password.

I also have Enterprise Edition. You may need to click the Manage Accounts button and configure it a bit.
Terry ClineTerry Cline
Thanksagain...so close...but no joy yet.

do you know what a "client ID" is? I have have salesforce.com org id, but that doesn't seem to make a difference.

My normal user and password don't do the trick - do i need some developer credentials?

I have no idea what you mean by security token or how to use it with my password, can you elaborate?

So close!

Mark PassovoyMark Passovoy
Of course. Salesforce has built in security features that help keep the people that should not be in Salesforce out of your org. One such feature is the security token which is unique to each user and updated when you update your password.

Go to Setup>Personal Setup>My Personal Information>Reset My Security Token

This will send you an email with your token which is a string of letters and numbers. Add this to the end of your password. For example, if your password is "password" and your token is "1234", your password+token would be password1234.
Terry ClineTerry Cline

that did the trick - thank you thank you thank you!