What's new? | Help | Directory | Sign in
Google
                
Search
for
Updated Nov 08, 2007 by ScholtzConsulting
Labels: Phase-Implementation
MembershipStatusCalc  
Membership Status (and stats) rollup

Overview

This rolls up certain membership-related statistics from Opps to Contacts or Accounts. Stats include:

from these, other fields like Member Status are calculated via formula

Basic Approach

A trigger on Opportunity fires whenever a Won membership-type opp is created or modified in certain ways. When this happens, the code looks at all Won member Opps related to that contact/HH or account, not just the opp that caused the trigger.

The stats listed above are figured based on the most recent or first membership opp for the HH/account, based on the MemberStartDate of each opp. (Stats pull from most recent membership, except for Join Date which pulls from first)

Individual opps roll up to all contacts in the HH of the primary contact role, regardless of other contact roles on the opp(s). Account opps roll up to account only.

(An account opp is defined as an opp related an account other than the default Individual acct, regardless of contact roles.)

(A membership type opp is determined by list of record types stored in Constants class.)

Limitations

Since we currently cannot trigger on Contact Roles, stats may get out of sync if a user changes contact roles on an individual opp after insert. Will need to provide a web service method to recalculate stats (single HH/acct and db-wide?)

Future Enhancements

definite:

possible:

Triggers

MembershipStatusRollup (Opportunity)

fires when:

in UI use, correct behavior may also depend on:

Classes

Schema

Tests

relies on:


Sign in to add a comment