You need to sign in to do that
Don't have an account?
CampaignMember creation php urgent please!
Hi,
I am having problems creating elements, in this case is campaign members. I am using the files from the php sample kit which refer to the urn:partner.soap.sforce.com
I can query anything perfectly, but for create calls nothing happens. Please give me a hand. I have looked around the forum for hours and I can't figure it out.
I have the endpoint , campaign id and contact id coming from a form. variables are passed ok.
$client = new SalesforceClient($SESSION); // $SESSION passed as a $_POST from the previous form.
$client->_endpoint = $_POST['sf_endpoint']; // endpoint passed as a $_POST from the previous form.
$FIELDS = array('type'=>'CampaignMember','CampaignId'=>'$camp_id','ContactId'=>'$contactid');
$result = $client->create($FIELDS);
if (PEAR::isError($result)) {
print "<p><span style=\"color:#FF0000\">".$result->getMessage()."<br /></span></p>";
}
this returns NO error, but nothing is created. Am I passing the correct requiered fields?
I am running PHP Version 4.3.10. If I need to post the soap response or xml response, can anybody show me how to do that please?
I appreciate your help!
alivepjc
P.S.: dreamforce 05 rocked!
I'm calling this:
echo "Response: ".$client->__getlastresponse()."\n";
right after my create call:
$FIELDS = array('type'=>'CampaignMember','CampaignId'=>'$camp_id','ContactId'=>'$contactid');
$result = $client->create($FIELDS);
I need to have created the soapClient with the trace option to 1.
SalesforceClient extends WebService_SforceService_Soap which extends SOAP_Client... how do I set the option to trace after creating the client ?
$client = new SalesforceClient($SESSION);
$client->_endpoint = $_POST['sf_endpoint'];
so basically my code looks like this:
$client = new SalesforceClient($SESSION);
$client->_endpoint = $_POST['sf_endpoint'];
$FIELDS = array('type'=>'CampaignMember','CampaignId'=>'$camp_id','ContactId'=>'$contactid');
$result = $client->create($FIELDS);
echo "Response: ".$client->__getlastresponse()."\n";
If it can't be done, what do I need to change in which file? I can't seem to find it anywhere in the boards.
thank you very much!
got it!
$client = new SalesforceClient($SESSION);
$client->_endpoint = $_POST['sf_endpoint'];
$client->__trace(1);
$FIELDS = array('type'=>'CampaignMember','CampaignId'=>$camp_id,'ContactId'=>$contacts);
$result = $client->create($FIELDS);
echo "Response: ".$client->__getlastresponse()."\n";
http://forums.sforce.com/sforce/board/message?board.id=PerlDevelopment&message.id=644