Find your content:

Search form

You are here

Custom Logic in Standard List View

 
Share

Our client wants to use the standard Contact List View functionality to display Lists of Contacts.

Let's say that there needs to be a List View called 'My Special Contacts'. The way to determine a 'Special Contact' is through a Custom Object, UserSpecialContacts__c which has a lookup to a user and a lookup to a Contact.

The logic for the My Special Contacts should therefore something like

List<Contact> c = Select Contact__c from UserSpecialContacts where User__c = (current running user).

Now, it looks as though I cannot achieve this through Salesforce filter logic etc. I understand that it may be possible as a report, but is there any way I can make this happen so that it appears as a list view? I can use Visualforce Pages if necessary, but rewriting the whole List View page is probably not an option so I would need to extend an existing component.


Attribution to: George S.

Possible Suggestion/Solution #1

One thing you could do is make the lookup to Contact from UserSpecialContacts Master-Detail, That way you can create a Roll-Up-Summary field on Contact for example:

  • Create Roll Up Summary Field: count_special_contacts__c (which just counts the amount of special contacts)

  • then in your filter of the list view you can create where count_special_contacts__c greater than 0

This way your view will only show contacts which has at least 1 special contact as child record

Your other option is writing the visualforce page or use a report


Attribution to: pjcarly

Possible Suggestion/Solution #2

I'm afraid you have to create a VF page and use it as a custom VF tab (since you can't even override the Contacts Tab).

Sir, it's an awesome question cracks me up that we can't do such a simple thing :) Does it really have to be a related object that drives the logic? Won't a (multiselect) picklist on Contact do, as nasty as it sounds in terms of maintenance?

EDIT: 3 more ideas:

  1. You can build listview filter on contacts using a Campaign (I won't be surprised if it works for only when you have "Marketing User" ticked) - would that work?
  2. Would it work for you to enable tags (maybe only personal tags)? They're still fairly easy to search from sidebar/global search and look like working with them is less hassle than inserting new entries on a related list. Maybe even combine it with a list view button for mass add/remove tags...
  3. Similar one about following them with Chatter?

Attribution to: eyescream
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/4099

My Block Status

My Block Content