Search Community
- Force.com Discussion Boards
- :
- Salesforce User Discussions
- :
- Best Practices Discussion
- :
- Re: Roll-up Summary Fields that aren't
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Roll-up Summary Fields that aren't
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
06-29-2009 12:33 PM
I need to be able to have two fields.
1.) on the Contact object - # of Campaigns
2.) on the Cases object - # of Activities
These fields will let me keep a Contact from getting to much marketing stuff and will help our Support QA department look at number of interactions.
I can't use roll-up summary fields. How should I tackle this problem?
Any advice you can offer is much appreciated.
Thanks,
Amber
Re: Roll-up Summary Fields that aren't
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
06-29-2009 12:50 PM
Re: Roll-up Summary Fields that aren't
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
06-29-2009 01:40 PM
The master-detail part is the issue. Has anyone come up with a workaround for look-ups? Isn't there a way to count the number of records in a related list that isn't part of a master-detail relationship.
Re: Roll-up Summary Fields that aren't
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
06-29-2009 04:48 PM
One workaround - use a Campaign Member trigger to increment a custom field on Contact any time a Contact is added to a campaign. You'd need a 2nd trigger (delete) to decrement the count any time this contact is removed.
Post on how to do this on campaigns (increment, not decrement):
http://blogs.salesforce.com/marketing/2009/05/trac
Increment Trigger syntax might look something like:
trigger UpdateCmpRegistered on CampaignMember (before update) { Contact c = [select Id, name from Contact where Id = :Trigger.new[0].ContactId limit 1]; for(CampaignMember cm : Trigger.new){ c.Registered__c += 1; } try{ update(c); } catch(DMLException e){ System.debug('Contact update failed:' + e); }//try }

