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">
     <notifications xmlns="http://soap.sforce.com/2005/09/outbound">
     <Ack>' . $returnedMsg . '</Ack>

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

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

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




Please help me in this.

Workflow rule :

Workflow rule

  • 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


You must log in to answer this question.

Browse other questions tagged .