Skip to content

Overview#

Class name: InitialiseCampaignMemberComponent Friendly name: Initialise Campaign Member Statuses Category: MoveData: NPSP Purpose: Creates and configures standardised Campaign Member Status records for campaigns with customisable labels and sort ordering

Class description#

This component facilitates the standardisation of Campaign Member Status structures across campaigns by creating a consistent five-tier status hierarchy. The class manages status creation, updates existing status configurations, and optionally removes non-standard statuses to ensure uniform campaign member management. It provides comprehensive customisation options for labels and sort orders whilst maintaining the hierarchical relationship structure essential for nonprofit campaign operations.

Input parameters#

Parameter API name Type Description
Campaign Id CampaignId Id (required) Campaign to configure with standardised member statuses
Label: #1 - Team Leader TeamLeaderLabel String Custom label for team leader status (default: "Team Leader")
Sort Order: #1 - Team Leader TeamLeaderSortOrder Integer Sort order for team leader status (default: 8921)
Label: #2 - Fundraiser FundraiserLabel String Custom label for fundraiser status (default: "Fundraiser")
Sort Order: #2 - Fundraiser FundraiserSortOrder Integer Sort order for fundraiser status (default: 8931)
Label: #3 - Recurring Donor RecurringDonorLabel String Custom label for recurring donor status (default: "Recurring Donor")
Sort Order: #3 - Recurring Donor RecurringDonorSortOrder Integer Sort order for recurring donor status (default: 8941)
Label: #4 - Donor DonorLabel String Custom label for donor status (default: "Donor")
Sort Order: #4 - Donor DonorSortOrder Integer Sort order for donor status (default: 8951)
Label: #5 - Prospect ProspectLabel String Custom label for prospect status (default: "Prospect")
Sort Order: #5 - Prospect ProspectSortOrder Integer Sort order for prospect status (default: 8961)
Delete Other Campaign Member Statuses DeleteOtherCampaignMemberStatuses Boolean Remove existing non-standard statuses (default: false)
Continue on Error ContinueOnError Boolean Suppress exceptions and continue processing (default: false)

Output parameters#

None

Behaviour#

Status hierarchy creation#

  • Creates five standardised campaign member statuses in hierarchical order from highest to lowest priority
  • Sets appropriate HasResponded values: true for all statuses except Prospect
  • Designates Prospect as the default status (IsDefault = true)
  • Configures sort orders to maintain proper hierarchy display in Salesforce

Existing status management#

  • Queries existing campaign member statuses and compares against target configuration
  • Preserves existing statuses that match the target label names
  • Identifies non-standard statuses for potential removal based on configuration
  • Updates sort orders and properties of matching existing statuses

Status cleanup operations#

  • Optionally removes existing statuses that don't match the standardised hierarchy
  • Handles deletion errors gracefully when statuses are in use by campaign members
  • Ensures clean status structure when DeleteOtherCampaignMemberStatuses is enabled

Default configuration values#

The component provides sensible defaults for all status configurations:

Status Default label Default sort order HasResponded IsDefault
Team Leader "Team Leader" 8921 true false
Fundraiser "Fundraiser" 8931 true false
Recurring Donor "Recurring Donor" 8941 true false
Donor "Donor" 8951 true false
Prospect "Prospect" 8961 false true

Error handling#

Duplicate sort order management#

  • Detects DUPLICATE_VALUE errors from conflicting sort orders
  • Provides specific error message guidance for sort order conflicts
  • Throws FlowComponentException with actionable resolution steps

DML exception handling#

  • Gracefully handles deletion failures for statuses currently in use
  • Suppresses delete errors to allow status creation to proceed
  • Provides debug logging for troubleshooting status management issues

Configurable error suppression#

  • Uses ContinueOnError flag to suppress all exceptions when enabled
  • Logs errors for debugging whilst allowing batch processing to continue
  • Supports scenarios where partial success is acceptable

Dependencies#

Required objects#

  • Campaign: Standard Salesforce object
  • CampaignMemberStatus: Standard Salesforce object for campaign member status configuration
Ask MoveData AI
Ask about setup, configuration, or troubleshooting
How can I help you with MoveData today?