{"id":"sforce_api_objects_campaignmember","title":"CampaignMember","content":"<a name=\"sforce_api_objects_campaignmember\"><!-- --></a><h1 class=\"helpHead1\">CampaignMember</h1><div class=\"body refbody\">\n<div class=\"shortdesc\"><span class=\"ph\" id=\"summary\"><a name=\"summary\"><!-- --></a>The CampaignMember object represents the relationship between a\n   campaign and either a lead or a contact. If the Accounts as Campaign Members setting is enabled\n   in an org, CampaignMember can also represent the relationship between a campaign and an\n   account.</span></div>\n\n  <div class=\"section\">\n<h2 class=\"helpHead2\">Supported Calls</h2>\n\n   \n   <p class=\"p\"><samp class=\"codeph nolang\">create()</samp>, <samp class=\"codeph nolang\">delete()</samp>,\n     <samp class=\"codeph nolang\">describeLayout()</samp>, <samp class=\"codeph nolang\">describeSObjects()</samp>, <samp class=\"codeph nolang\">getDeleted()</samp>, <samp class=\"codeph nolang\">getUpdated()</samp>, <samp class=\"codeph nolang\">query()</samp>,\n     <samp class=\"codeph nolang\">retrieve()</samp>, <samp class=\"codeph nolang\">update()</samp>,\n     <samp class=\"codeph nolang\">upsert()</samp></p>\n\n  </div>\n\n  <div class=\"section\" id=\"custom_portal_no_access_section\">\n<a name=\"custom_portal_no_access_section\"><!-- --></a><h2 class=\"helpHead2\">Special Access Rules</h2>\n\n   \n   <p class=\"p\">Customer Portal users can’t access this object.</p>\n\n  </div>\n\n  <div class=\"section\">\n<h2 class=\"helpHead2\">Fields</h2>\n\n   \n   \n<div class=\"data colSort\"><table class=\"featureTable sort_table\" summary=\"\">\n     \n     \n     <thead class=\"thead sorted\" align=\"left\">\n      <tr>\n       <th class=\"featureTableHeader  \" id=\"d307053e104\">Field</th>\n\n       <th class=\"featureTableHeader  \" id=\"d307053e107\">Details</th>\n\n      </tr>\n\n     </thead>\n\n     <tbody class=\"tbody\">\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">AccountId</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">reference</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Create, Filter, Group, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">ID of the account related to the campaign. This field is available only if the\n           Accounts as Campaign Members setting is enabled in the org.</dd>\n\n          <dd class=\"dd\">This field is a relationship field.</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Relationship Name</dt>\n\n          <dd class=\"dd\">Related Record ID</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Relationship Type</dt>\n\n          <dd class=\"dd\">Lookup</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Refers To</dt>\n\n          <dd class=\"dd\">Account</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\" id=\"i1443868\"><a name=\"i1443868\"><!-- --></a>CampaignId</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">reference</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Create, Filter, Group, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">Required. The ID of the campaign related to the lead or contact.</dd>\n\n          <dd class=\"dd\">This field is a relationship field.</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Relationship Name</dt>\n\n          <dd class=\"dd\">Campaign</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Relationship Type</dt>\n\n          <dd class=\"dd\">Lookup</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Refers To</dt>\n\n          <dd class=\"dd\">Campaign</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">City</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">string</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">The city for the address of the lead or contact. In orgs with the Accounts as Campaign\n           Members setting enabled, this field can be the city for the account.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">CompanyOrAccount</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">string</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">The company or account of the lead or contact.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\">\n        <span class=\"keyword parmname\" id=\"i1443898\"><a name=\"i1443898\"><!-- --></a>ContactId</span>\n       </td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">reference</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Create, Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">Required. The ID of a contact that's related to the campaign.</dd>\n\n          <dd class=\"dd\">This field is a relationship field.</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Relationship Name</dt>\n\n          <dd class=\"dd\">Contact</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Relationship Type</dt>\n\n          <dd class=\"dd\">Lookup</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Refers To</dt>\n\n          <dd class=\"dd\">Contact</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">CurrencyIsoCode</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">picklist</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Create, Defaulted on create, Filter, Group, Nillable, Restricted picklist, Sort,\n           Update</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\"><span class=\"ph\" id=\"campaign_currencyiso_desc\"><a name=\"campaign_currencyiso_desc\"><!-- --></a>Available only for organizations with the\n            multicurrency feature enabled. This field contains the ISO code for any currency allowed\n            by the organization.</span></dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">Country</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">string</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">The country for the address of the lead or contact. In orgs with the Accounts as\n           Campaign Members setting enabled, this field can be the country for the account.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">Description</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">textarea</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Nillable</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">The description of the associated lead or contact. In orgs with the Accounts as\n           Campaign Members setting enabled, this field can be the description of the account.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">DoNotCall</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">boolean</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Defaulted on create, Filter, Group, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">Indicates that the lead or contact doesn’t want to be called. In orgs with the\n           Accounts as Campaign Members setting enabled, this field can indicate the account doesn’t\n           want to be called.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">Email</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">email</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">Email address for the lead or contact. In orgs with the Accounts as Campaign Members\n           setting enabled, this field can be the email address for the account.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">Fax</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">phone</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">Fax number for the lead or contact. In orgs with the Accounts as Campaign Members\n           setting enabled, this field can be the fax number for the account.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">FirstName</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">string</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">The first name of the lead or contact.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\">\n        <span class=\"keyword parmname\">FirstRespondedDate</span>\n       </td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">date</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">This field indicates the date that the campaign member received a status of\n           Responded.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">HasOptedOutOfEmail</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">boolean</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Defaulted on create, Filter, Group, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">This field indicates the email opt-out preference for the lead or contact. A value of\n            <samp class=\"codeph nolang\">false</samp> indicates that the lead or contact is opted\n           in to emails. A value of <samp class=\"codeph nolang\">true</samp> indicates that they’re\n           opted out. In orgs with the Accounts as Campaign Members setting enabled, this field can\n           be the opt-out preference for the account email address.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">HasOptedOutOfFax</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">boolean</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Defaulted on create, Filter, Group, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">This field indicates the fax opt-out preferences for the lead or contact. A value of\n           false indicates that the lead or contact is opted in to receiving faxes. A value of true\n           indicates that they’re opted out. In orgs with the Accounts as Campaign Members setting\n           enabled, this field can indicate the account has opted out of faxes.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\">\n        <span class=\"keyword parmname\" id=\"i1443942\"><a name=\"i1443942\"><!-- --></a>HasResponded</span>\n       </td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">boolean</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Defaulted on create, Filter, Group, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">This field indicates whether the campaign member has responded to the campaign\n            (<samp class=\"codeph nolang\">true</samp>) or not (<samp class=\"codeph nolang\">false</samp>). Label is <strong class=\"ph b\">Responded</strong>.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">LastName</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">string</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">The last name of the lead or contact. The limit is 80 characters.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\">\n        <span class=\"keyword parmname\" id=\"i1443977\"><a name=\"i1443977\"><!-- --></a>LeadId</span>\n       </td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">reference</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Create, Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">Required. The ID of a lead that's related to the campaign.</dd>\n\n          <dd class=\"dd\">This field is a relationship field.</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Relationship Name</dt>\n\n          <dd class=\"dd\">Lead</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Relationship Type</dt>\n\n          <dd class=\"dd\">Lookup</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Refers To</dt>\n\n          <dd class=\"dd\">Lead</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">LeadOrContactId</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">reference</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">\n           <p class=\"p\">The ID of a lead or contact that's related to the campaign. In orgs with the Accounts\n            as Campaign Members setting enabled, this field also accepts an account ID.</p>\n\n          </dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">LeadOrContactOwnerId</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">reference</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">The ID of the owner of the associated lead or contact owner. In orgs with the Accounts\n           as Campaign Members setting enabled, this field can be the owner of the account.</dd>\n\n          <dd class=\"dd\">This field is a polymorphic relationship field.</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Relationship Name</dt>\n\n          <dd class=\"dd\">LeadOrContactOwner</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Relationship Type</dt>\n\n          <dd class=\"dd\">Lookup</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Refers To</dt>\n\n          <dd class=\"dd\">Group, User</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">LeadSource</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">picklist</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">The source where the lead was obtained.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">MobilePhone</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">phone</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">The mobile phone number of the lead or contact. In orgs with the Accounts as Campaign\n           Members setting enabled, this field can be the mobile phone number for the account.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">Name</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">string</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">The first and last name of the lead or contact that's related to the campaign\n           member.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">Phone</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">phone</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">The phone number of the lead or contact. In orgs with the Accounts as Campaign Members\n           setting enabled, this field can be the phone number for the account.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">PostalCode</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">string</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">The postal code for the lead or contact. In orgs with the Accounts as Campaign Members\n           setting enabled, this field can be the postal code for the account.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\" id=\"i1438294\"><a name=\"i1438294\"><!-- --></a>RecordTypeId</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">reference</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Create, Filter, Nillable, Update</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">ID of the record type assigned to this object. To change the record type, modify the\n            <span class=\"keyword parmname\">CampaignMemberRecordTypeId</span> field on the associated Campaign. </dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">Salutation</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">picklist</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">Salutation for the lead or contact.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">State</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">string</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">The state for the address of the lead or contact. The limit is 80 characters. In orgs\n           with the Accounts as Campaign Members setting enabled, this field can be the state of the\n           account address.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\" id=\"i1444004\"><a name=\"i1444004\"><!-- --></a>Status</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">picklist</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Create, Filter, Group, Nillable, Sort, Update</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">Controls the <span class=\"keyword parmname\">HasResponded</span> flag on this object. You can't directly\n           set the <span class=\"keyword parmname\">HasResponded</span> flag, as it’s read-only. You can set it\n           indirectly by setting this field in a create or update call. Each predefined value\n           implies a <span class=\"keyword parmname\">HasResponded</span> flag value. Each time you update this field,\n           you implicitly update the <span class=\"keyword parmname\">HasResponded</span> flag. In the Salesforce user\n           interface, Marketing users can define valid status values for the\n            <span class=\"keyword parmname\">Status</span> picklist. They can choose one status as the default status.\n           For each <span class=\"keyword parmname\">Status</span> field value, they can also select which values to\n           count as “Responded,” meaning that the <span class=\"keyword parmname\">HasResponded</span>\n           flag is set to <samp class=\"codeph nolang\">true</samp> for those values. The limit is\n           40 characters.<p class=\"p\">When you create or update campaign members, use the text value for\n             <span class=\"keyword parmname\">Status</span> instead of the ID from the CampaignMemberStatus\n           object.</p>\n</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">Street</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">string</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">The street for the address of the lead or contact. In orgs with the Accounts as\n           Campaign Members setting enabled, this field can be the street of the account\n           address.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">Title</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">string</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">Title for the lead or contact.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n      <tr>\n       <td class=\"entry\" headers=\"d307053e104\" data-title=\"Field\"><span class=\"keyword parmname\">Type</span></td>\n\n       <td class=\"entry\" headers=\"d307053e107\" data-title=\"Details\">\n        <dl class=\"dl detailList\">\n         \n          <dt class=\"dt dlterm\">Type</dt>\n\n          <dd class=\"dd\">string</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Properties</dt>\n\n          <dd class=\"dd\">Filter, Group, Nillable, Sort</dd>\n\n         \n         \n          <dt class=\"dt dlterm\">Description</dt>\n\n          <dd class=\"dd\">Indicates if the campaign member is a lead or a contact. In orgs with the Accounts as\n           Campaign Members setting enabled, this field can indicate an account.</dd>\n\n         \n        </dl>\n\n       </td>\n\n      </tr>\n\n     </tbody>\n\n    </table></div>\n\n   <div class=\"box message info\"><div class=\"inner\"><div class=\"bd\"><div class=\"media\">\n<img class=\"img mtm\" src=\"/docs/resources/img/en-us/256.0?doc_id=images%2Ficon_note.png&folder=object_reference\" alt=\"Note\"><div class=\"mediaBd\">\n<h4 class=\"mbs\">Note</h4>\n<p>If you’re importing CampaignMember data into Salesforce and want to set the value for an\n    audit field, such as <span class=\"keyword parmname\">CreatedDate</span>, contact Salesforce. Audit fields are\n    automatically updated during API operations unless you request to set these fields\n    yourself.</p>\n</div>\n</div></div></div></div>\n\n  </div>\n\n  <div class=\"section\">\n<h2 class=\"helpHead2\">Usage</h2>\n\n   \n   <p class=\"p\">Each record has a unique ID, and must contain either a <span class=\"keyword parmname\">ContactId</span> or a\n     <span class=\"keyword parmname\">LeadId</span>, but can't contain both. Any attempt to create a single record with\n    both results in a successful insert but only the <span class=\"keyword parmname\">ContactId</span> is inserted.\n    However, you can create two separate records on a Campaign—one for the Lead and one for\n    the Contact.</p>\n\n   <p class=\"p\">In orgs with the Accounts as Campaign Members setting enabled, the unique ID can be an\n     <span class=\"keyword parmname\">AccountID</span>.</p>\n\n   <div class=\"p\">Standard fields from a lead or contact are associated with the CampaignMember object, but you\n    can’t query them directly. To include a <span class=\"keyword parmname\">Phone</span> in your query, for example,\n    query the field from the Lead\n    object.<div class=\"codeSection soql\"><pre class=\"codeblock brush:plain\">SELECT Id, (SELECT Phone FROM Lead)\nFROM CampaignMember</pre></div>\n</div>\n\n   <p class=\"p\">This object is defined only for orgs that have the marketing feature and valid marketing\n    licenses. If your org doesn’t have the marketing feature or valid marketing licenses, this\n    object doesn’t appear in the <samp class=\"codeph nolang\">describeGlobal()</samp> call, and you\n    can't use <samp class=\"codeph nolang\">describeSObjects()</samp> or <samp class=\"codeph nolang\">query()</samp> with this object.</p>\n\n   <div class=\"box message info\"><div class=\"inner\"><div class=\"bd\"><div class=\"media\">\n<img class=\"img mtm\" src=\"/docs/resources/img/en-us/256.0?doc_id=images%2Ficon_note.png&folder=object_reference\" alt=\"Note\"><div class=\"mediaBd\">\n<h4 class=\"mbs\">Note</h4>\n<p>If you want to track lead-based campaign members you convert to contacts, provide both a\n    ContactId and a LeadId. Otherwise, only use one ID type.</p>\n</div>\n</div></div></div></div>\n\n   <p class=\"p\">To issue <samp class=\"codeph nolang\">create()</samp> requests to the API, your account only\n    requires read access to campaigns.</p>\n\n   <p class=\"p\">If the record doesn’t exist for the specified <span class=\"keyword parmname\">ContactId</span> or\n     <span class=\"keyword parmname\">LeadId</span>, then a new record is created. If the record exists, an error is\n    returned and no update is made. To update an existing record, specify the ID of the\n    CampaignMember record to update.</p>\n\n   <p class=\"p\">To delete a record, specify the ID of the CampaignMember record.</p>\n\n   <p class=\"p\">When creating or updating records, the <span class=\"keyword parmname\">Status</span> field value specified in\n    the call is verified as a valid status for the given Campaign:</p>\n\n   <ul class=\"ul bulletList\">\n    <li class=\"li\">If the specified <span class=\"keyword parmname\">Status</span> value is a valid status, the value is updated,\n     and the <span class=\"keyword parmname\">HasResponded</span> field is updated to either <samp class=\"codeph nolang\">true</samp> or <samp class=\"codeph nolang\">false</samp>, depending on\n     the <span class=\"keyword parmname\">Status</span> value association with <span class=\"keyword parmname\">HasResponded</span>.</li>\n\n    <li class=\"li\">If the specified <span class=\"keyword parmname\">Status</span> value isn’t a valid status, the API assigns the\n     default status to the <span class=\"keyword parmname\">Status</span> field and updates the\n      <span class=\"keyword parmname\">HasResponded</span> field with the associated value. However, if the given\n     Campaign doesn’t have a default status, the API assigns the value specified in the call to the\n      <span class=\"keyword parmname\">Status</span> field, and the <span class=\"keyword parmname\">HasResponded</span> field is set to\n      <samp class=\"codeph nolang\">false</samp>.</li>\n\n   </ul>\n\n  </div>\n\n  <div class=\"section\">\n<h2 class=\"helpHead2\">Associated Objects</h2>\n\n   \n   <p class=\"p\">This object has the following associated objects. If the API version isn’t specified, they’re\n    available in the same API versions as this object. Otherwise, they’re available in the specified\n    API version and later.</p>\n\n   <dl class=\"dl detailList\">\n    \n     <dt class=\"dt dlterm\">\n<a class=\"xref\" href=\"atlas.en-us.256.0.object_reference.meta/object_reference/sforce_api_associated_objects_change_event.htm\" title=\"A ChangeEvent object is available for each object that supports Change Data Capture. You can subscribe to a stream of change events using Change Data Capture to receive data tied to record changes in Salesforce. Changes include record creation, updates to an existing record, deletion of a record, and undeletion of a record. A change event isn’t a Salesforce object—it doesn’t support CRUD operations or queries. It’s included in the object reference so you can discover which Salesforce objects support change events.\">CampaignMemberChangeEvent</a> (API version 46.0)</dt>\n\n     <dd class=\"dd\">Change events are available for the object.</dd>\n\n    \n   </dl>\n\n  </div>\n\n </div><div id=\"sfdc:seealso\" class=\"related-links\">\n<div class=\"relinfo\">\n<h4>See Also</h4>\n<ul class=\"unstyled\">\n<li><div><a class=\"link\" href=\"atlas.en-us.256.0.object_reference.meta/object_reference/sforce_api_objects_campaign.htm\" title=\"Represents and tracks a marketing campaign, such as a direct mail promotion, webinar, or trade show.\">Campaign</a></div></li>\n<li><div><a class=\"link\" href=\"atlas.en-us.256.0.object_reference.meta/object_reference/sforce_api_objects_campaignmemberstatus.htm\" title=\"One or more member status values defined for a campaign.\">CampaignMemberStatus</a></div></li>\n</ul>\n</div>\n</div>"}