function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Meredith MeyersMeredith Meyers 

Does anyone have experience writing Update() code on the Campaign Member status using SOAP API in PHP?

Does anyone have experience writing Update() code on the Campaign Member object to update the Status field using SOAP API in PHP? We’re stumped how to do this. Seems there are some limitations with using Upsert() function on the Campaign Member and wonder if there is a way to at least use an update() call. Ours may just be a syntax issue.

This is the code we’re trying to use:
if ($campaign_member_id) {
$mainResp = $mySFConnection->update($mainCM, 'CampaignMember');
//$mainResp = $mySFConnection->upsert('Id', $mainCM, 'CampaignMember');
echo "*** Campaign Member ID exists *** ";
var_dump($mainCM);
} else {
$mainResp = $mySFConnection->create($mainCM, 'CampaignMember');
echo "*** No Campaign Member ID *** ";
var_dump($mainCM);
}
Raj VakatiRaj Vakati
When creating or updating campaign members, use the text value for Statusinstead of the ID from the CampaignMemberStatus object.


Set HasResponded  flag on the CampaignMember