0

I want to get newly created contact record data using outbound messages. I used below code and set workflow rule on "created" with criteria like Account Name is equal to "test". But every time when I create record below code gives me all the records associated with that Account Name.

function respond($returnedMsg) {
     print '<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <soapenv:Body>
     <notifications xmlns="http://soap.sforce.com/2005/09/outbound">
     <Ack>' . $returnedMsg . '</Ack>
     </notifications>
     </soapenv:Body>
     </soapenv:Envelope>';
}

 header("Content-Type: text/xml\r\n");
 ob_start();

 $capturedData = fopen('php://input', 'rb');
 $content = fread($capturedData,5000);

 $outputFile = fopen("capturedData.txt", "a");
fwrite($outputFile, $content.PHP_EOL);
fclose($outputFile);

fclose($capturedData);

ob_end_clean();

respond('true');

Please help me in this.

Workflow rule :

Workflow rule

6
  • How is this function triggered and where does it have any selection criteria for the data?
    – Dave Humm
    Commented Dec 2, 2016 at 9:38
  • I have set endpoint URL with this code file. Commented Dec 2, 2016 at 9:39
  • Also I have created workflow rule with created and criteria like "Account name = test". Commented Dec 2, 2016 at 9:41
  • Please also include the workflow rule in the question as it may be where the issue lies.
    – Dave Humm
    Commented Dec 2, 2016 at 9:44
  • Hi Dave please find workflow rule screenshot. Commented Dec 2, 2016 at 9:49

0

You must log in to answer this question.

Browse other questions tagged .