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
cfdudecfdude 

INVALID_TYPE: Must send a concrete entity type.

I'm using ColdFusion 9 and a SalesForce cfc that I updated to work with version 22.  Everything had been working fine for a while but this week, all of a sudden, I'm getting the above "invalid_type" error when trying to create a lead.  I'm sending to Enterprise API, btw.

 

Here is a sample soap request:

 

<?xml version="1.0" encoding="utf-8"?>
    <soapenv:Envelope
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:urn="urn:enterprise.soap.sforce.com"
        xmlns:urn1="urn:sobject.enterprise.soap.sforce.com"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <urn:SessionHeader>
            <urn:sessionId>(removed for clarity)</urn:sessionId>
        </urn:SessionHeader>
        <urn:AssignmentRuleHeader>
            <urn:useDefaultRule>true</urn:useDefaultRule>
        </urn:AssignmentRuleHeader>
    </soapenv:Header>
    <soapenv:Body>
        <urn:create>
            <urn:sObjects xsi:type="urn1:Lead">
                <COMPANY>TestCo</COMPANY>
                <DESCRIPTION>Signed up at: Referring IP: 127.0.0.1 </DESCRIPTION>
                <HOW_DID_YOU_HEAR_ABOUT_US__C>general event</HOW_DID_YOU_HEAR_ABOUT_US__C>
                <LEADSOURCE>Web Trial</LEADSOURCE>
                <STATUS>Incomplete Registration</STATUS>
                <OWNER>Jimbo Smith</OWNER>
                <INDUSTRY>Computing</INDUSTRY>
                <PHONE>310-555-1212</PHONE>
                <FIRSTNAME>Joe</FIRSTNAME>
                <DATE_OF_INQUIRY__C>2011-07-25</DATE_OF_INQUIRY__C>
                <EMAIL>test@here.com</EMAIL>
                <OTHER__C>Aug 4th Japan style inflation</OTHER__C>
                <TYPE__C>Lead</TYPE__C>
                <LASTNAME>Blow</LASTNAME>
                <TITLE>Chief Janitor</TITLE>
            </urn:sObjects>
        </urn:create>
    </soapenv:Body>
</soapenv:Envelope> 



Best Answer chosen by Admin (Salesforce Developers) 
cfdudecfdude

In case anyone else happens to get here.  I figured out my own problem.  I was attempting to send a simple value for "Owner" when that field is a complex type.  This really seems like a crappy error to get for this type of problem but it is what it is.  If anyone else wants to know the work around, here is the 'working' soaprequest:

 

<?xml version="1.0" encoding="utf-8"?>
    <soapenv:Envelope
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:urn="urn:enterprise.soap.sforce.com"
        xmlns:urn1="urn:sobject.enterprise.soap.sforce.com

"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <urn:SessionHeader>
            <urn:sessionId>(removed for clarity)</urn:sessionId>
        </urn:SessionHeader>
        <urn:AssignmentRuleHeader>
            <urn:useDefaultRule>true</urn:useDefaultRule>
        </urn:AssignmentRuleHeader>
    </soapenv:Header>
    <soapenv:Body>
        <urn:create>
            <urn:sObjects xsi:type="urn1:Lead">
                <COMPANY>TestCo</COMPANY>
                <DESCRIPTION>Signed up at: Referring IP: 127.0.0.1 </DESCRIPTION>
                <HOW_DID_YOU_HEAR_ABOUT_US__C>general event</HOW_DID_YOU_HEAR_ABOUT_US__C>
                <LEADSOURCE>Web Trial</LEADSOURCE>
                <STATUS>Incomplete Registration</STATUS>
                <OWNER xsi:type="urn1:User">
                    <username>email@domain.com</username>
                </OWNER>
                <INDUSTRY>Computing</INDUSTRY>
                <PHONE>310-555-1212</PHONE>
                <FIRSTNAME>Joe</FIRSTNAME>
                <DATE_OF_INQUIRY__C>2011-07-25</DATE_OF_INQUIRY__C>
                <EMAIL>test@here.com</EMAIL>
                <OTHER__C>Aug 4th Japan style inflation</OTHER__C>
                <TYPE__C>Lead</TYPE__C>
                <LASTNAME>Blow</LASTNAME>
                <TITLE>Chief Janitor</TITLE>
            </urn:sObjects>
        </urn:create>
    </soapenv:Body>
</soapenv:Envelope> 



All Answers

cfdudecfdude

In case anyone else happens to get here.  I figured out my own problem.  I was attempting to send a simple value for "Owner" when that field is a complex type.  This really seems like a crappy error to get for this type of problem but it is what it is.  If anyone else wants to know the work around, here is the 'working' soaprequest:

 

<?xml version="1.0" encoding="utf-8"?>
    <soapenv:Envelope
        xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        xmlns:urn="urn:enterprise.soap.sforce.com"
        xmlns:urn1="urn:sobject.enterprise.soap.sforce.com

"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <urn:SessionHeader>
            <urn:sessionId>(removed for clarity)</urn:sessionId>
        </urn:SessionHeader>
        <urn:AssignmentRuleHeader>
            <urn:useDefaultRule>true</urn:useDefaultRule>
        </urn:AssignmentRuleHeader>
    </soapenv:Header>
    <soapenv:Body>
        <urn:create>
            <urn:sObjects xsi:type="urn1:Lead">
                <COMPANY>TestCo</COMPANY>
                <DESCRIPTION>Signed up at: Referring IP: 127.0.0.1 </DESCRIPTION>
                <HOW_DID_YOU_HEAR_ABOUT_US__C>general event</HOW_DID_YOU_HEAR_ABOUT_US__C>
                <LEADSOURCE>Web Trial</LEADSOURCE>
                <STATUS>Incomplete Registration</STATUS>
                <OWNER xsi:type="urn1:User">
                    <username>email@domain.com</username>
                </OWNER>
                <INDUSTRY>Computing</INDUSTRY>
                <PHONE>310-555-1212</PHONE>
                <FIRSTNAME>Joe</FIRSTNAME>
                <DATE_OF_INQUIRY__C>2011-07-25</DATE_OF_INQUIRY__C>
                <EMAIL>test@here.com</EMAIL>
                <OTHER__C>Aug 4th Japan style inflation</OTHER__C>
                <TYPE__C>Lead</TYPE__C>
                <LASTNAME>Blow</LASTNAME>
                <TITLE>Chief Janitor</TITLE>
            </urn:sObjects>
        </urn:create>
    </soapenv:Body>
</soapenv:Envelope> 



This was selected as the best answer
gnasagnasa

Hi,

 

thanx.. your pointer helped me as well