+ Start a Discussion
SenyorsSenyors 

Obtaining Contact View Information?

I've been tasked to build a .NET web application (VB) that will connect with our SalesForce.com data and allow our salespeople to select an in-house email template for mass mailings through our own in-house mail servers. I have everything setup in Visual Studio 2005, the WSDL is in place, and I have some initial code running that allows me to successfully log into the API and retrieve some basic information (user name, company, etc.). So far, all is going well.
 
Now, I want to create a dropdown menu that contains any and all contact "views" established by the user. In SalesForce.com, I can create a new view and assign specific contacts to that view, allowing me to manage different groups of folks to potentially email. However, I can't seem to find any reference to these views in the Apex API. I presume there is some sort of mechanism I can use to capture what views have been created by a particular user, so in turn I can capture the appropriate contacts for that view.
 
Can anyone point me in the right direction here?
sfdcfoxsfdcfox
Unless I'm mistaken, there's no API for "meta-data", such as list views, so you can't actually retrieve such a list. As simple as it seems, that's just something that's not there right now (please feel free to correct me if I'm wrong). Instead, have the user create "views" in your application instead (it's just a type of query). That should be easy enough to code...

~ sfdcfox ~
SenyorsSenyors

Thanks for the response. Naturally, my goal is to do as little programming as possible; while I can simulate views through code, it also potentially expands the scope of my project, especially since I may need to pull down all of my sales agents contacts and allow those agents to individually select which contacts they actually want to reach.

I'll have to give this matter further thought, but thanks for the feedback.  :smileyhappy:

SenyorsSenyors
Is there a way to add custom fields to each contact and query against those fields? For example, could I add five new custom fields (Group1, Group2, Group3, Group4 and Group5) that, when checked, indicate that the contact belongs to that arbitrary group? That way, I could then build a dropdown menu in my code that lists the five groups and only returns those contacts assigned to the selected group. Is that possible?
sfdcfoxsfdcfox
You could do that, or you could create a custom object called "List View" and create about 32 custom fields (name of the object the view is for, (field, operator, value) ten times, and one for "advanced options"). Then you can use custom object sharing to limit the list views to the appropriate users. Finally, write some code to support the custom object and bingo... list views.

Or you can create your custom fields and do it that way. I think a "configuration object" is far more flexible, though...

~ sfdcfox ~
ZitizonXZitizonX
hello Sfdcfox,Senyors
 
Since you talked about custom objects I would like to raise another question here. Wouldn't that be possible to write the object data in to a XML file and read it back as META data, so you can have views? Please correct me if I'm not in the line of understanding the question.
 
Where can we find info about custom objects?
 
Zitizon X
ZitizonXZitizonX
I have found some info about custom object and fields in the SF user guide. Ta
 
SenyorsSenyors

First, thanks to everyone for the help. For those folks following this thread, we're a fairly small organization with just a few dozen field reps. So, the solution we decided on was to add five new checkbox fields to the SalesForce.com contacts system (Group1, Group2, Group3, Group4 and Group5) and associate them with arbitrary groups of contacts to be emailed (the reps decide which contacts to associate with which groups).

To review, we're building an in-house solution to mass email our contacts, and we already have the programming in place to now allow a rep to select which group to email, leveraging the five new groups introduced above. We were easily able to code against these five new groups, and our in-house solution is already nearly done.

Again, thanks for the help and suggestions. Our first encounter with the Apex API has been a pleasant and successful one.  :smileyvery-happy: