Represents the association between a Campaign and either a Lead or Contact.
create(), update(), delete(), describeSObjects(), query(), retrieve(), getDeleted(), getUpdated()
API version 16.0 and later: upsert()
| Field | Field Type | Field Properties | Description |
|---|---|---|---|
| CampaignId | reference | Create | Required. ID of the Campaign to which this Lead or Contact is associated. For information on IDs, see ID Field Type. |
| ContactId | reference | Create | Required. ID of the Contact who is associated with a Campaign. |
| CurrencyIsoCode | picklist | Create | Available only for organizations with the multicurrency feature enabled. Contains the ISO code for any currency allowed by the organization. |
| FirstRespondedDate | date | Filter | Indicates the date on which the campaign member was first given a responded status. |
| HasResponded | boolean | Defaulted on create | Indicates whether the campaign member has responded to the campaign (true) or not (false). Label is Responded. |
| LeadId | reference | Create | Required. ID of the Lead who is associated with a Campaign. |
| RecordTypeId | reference | Filter | ID of the record type assigned to this object. To change the record type, modify the CampaignMemberRecordTypeId field on the associated Campaign. |
| Status | picklist | Create | Controls the HasResponded flag on this object. You cannot directly set the HasResponded flag, as it is read-only, but you can set it indirectly
by setting this field in a create or update call. Each predefined
value implies a HasResponded flag value. Each time you update this field, you
implicitly update the HasResponded flag. In the Salesforce.com user
interface, Marketing Users can define valid status values for the Status picklist. They can choose one status as the default status.
For each Status field value, they can also select which values
should be counted as “Responded,” meaning that the HasResponded flag will be set to true for those values. 40 character limit. |
Each record has a unique ID, and must contain either a ContactId or a LeadId, but cannot contain both. Any attempt to create a single record with both results in a successful insert but only the ContactId will be inserted. However, you can create two separate records on a Campaign—one for the Lead and one for the Contact.
This object is defined only for those organizations that have the marketing feature and valid marketing licenses. In addition, the object is accessible only to those users that are enabled as marketing users. If the organization does not have the marketing feature or valid marketing licenses, this object does not appear in the describeGlobal() call, and you cannot use describeSObjects() or query() with the CampaignMember object.
In API versions 15.0 and earlier, if you submit multiple records using a single create() call, and if more than one record matches an existing record, only the first record submitted updates the existing record. If any of the submitted records match each other but do not match existing records, only the last record submitted is created.
To create and update records at the same time in API version 16.0 and later, use the upsert() call; in earlier API versions, the upsert() call is not supported. To use the upsert() call on this object, you must first delete all data in ID fields except the record ID.
To delete a record, use the delete() call and specify the ID of the CampaignMember record to delete.
During a create() or update() call, the Status field value specified in the call is verified as a valid status for the given Campaign: