2

I am using php SOAP to post lead data to my client's SAGE CRM, the record get created (with crmid returned) but contains empty values. For some unknown reason my xml packet is being ignored. The SAGE documentation does not give an xml example for adding record (addrecord) to the CRM. Can someone please help? What is the right xml format for addrecord function?

Christian
  • 53
  • 8

1 Answers1

0

I know this was a question back in 2013 but better have it answered in case someone else comes looking for a solution.

The following is a sample for the upload of a new opportunity into Sage CRM. I have not seen the xml you are generating but I would start by using add instead of addrecord. I have not used addrecord before so I can't help you understanding this format for uploading data.

Please note the *Specified fields as they are important. Any field to be populated which has a related *Specified field must have it set to true. Otherwise the field might not be populated.

Most of the values on the sample bellow must be replaced by actual values. The SID being the most important one.

You may enter multiple <records> within the <add> tags.

<?xml version='1.0' encoding='utf-8' ?>
<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<soap:Header>
    <SessionHeader xmlns='http://tempuri.org/type'>
        <sessionId>SID</sessionId>
    </SessionHeader>
</soap:Header>
<soap:Body>
    <add xmlns='http://tempuri.org/type'>
        <entityname>opportunity</entityname>
            <records xsi:type='opportunity'>
                <description>description</description>
                <forecast>forecast_value</forecast>
                <forecastSpecified>true</forecastSpecified>
                <certainty>certainty</certainty>
                <certaintySpecified>true</certaintySpecified>
                <targetclose>targetclose</targetclose>
                <targetcloseSpecified>true</targetcloseSpecified>
                <forecast_cid>forecast_cid</forecast_cid>
                <forecast_cidSpecified>true</forecast_cidSpecified>
                <total_cid>total_cid</total_cid>
                <total_cidSpecified>true</total_cidSpecified>
                <totalorders_cid>total_orders_cid</totalorders_cid>
                <totalorders_cidSpecified>true</totalorders_cidSpecified>
                <totalquotes_cid>totalquotes_cid</totalquotes_cid>
                <totalquotes_cidSpecified>true</totalquotes_cidSpecified>
                <source>source</source>
                <type>type</type>
                <stage>stage</stage>
                <status>status</status>
                <assigneduserid>assigneduserid</assigneduserid>
                <assigneduseridSpecified>true</assigneduseridSpecified>
                <channelid>channelid</channelid>
                <channelidSpecified>true</channelidSpecified>
                <priority>priority</priority>
                <currency>cid</currency>
                <currencySpecified>true</currencySpecified>
                <primarycompanyid>primarycompanyid</primarycompanyid>
                <primarycompanyidSpecified>true</primarycompanyidSpecified>
                <primarypersonid>primarypersonid</primarypersonid>
                <primarypersonidSpecified>true</primarypersonidSpecified>
            </records>
        </add>
    </soap:Body>
</soap:Envelope>

You can find the web services documentation at https://community.sagecrm.com/user_community/m/cloud_documentation/27076.aspx

Download the wsdl file to get more details about each field and entity available.