2

I need to specify a RecordTypeId in Upsert SOAP call for Account Object. I have tried following.

    <urn:upsert xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <urn:externalIDFieldName>External_ID_vod__c</urn:externalIDFieldName>
        <urn:sObjects xsi:type="sf:Account">
            <External_ID_vod__c>IT21_1100072988</External_ID_vod__c>
            <RecordTypeId>Test1</RecordTypeId>

However I get the following error.

        <errors>
           <fields>RecordTypeId</fields>
           <message>Record Type ID: id value of incorrect type: Test1</message>
           <statusCode>MALFORMED_ID</statusCode>
        </errors>

Could someone please provide guidance on how to specify this. Any link to official documentation for this field is also fine.

Thanks in advance, Vikas

2 Answers 2

1

Instead of name, you must provide ID of the record Type not its name. It looks like this:

<urn:upsert xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:sf="urn:sobject.enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <urn:externalIDFieldName>External_ID_vod__c</urn:externalIDFieldName>
        <urn:sObjects xsi:type="sf:Account">
            <External_ID_vod__c>IT21_1100072988</External_ID_vod__c>
            <RecordTypeId>01240000000QKE5</RecordTypeId>
3
  • Thanks Ashwani. Yes that works. But I was after something like this - <RecordTypeId xsi:type="RecordType"> <Name>Test1</Name> </RecordTypeId>
    – vikas112
    Sep 24, 2015 at 11:57
  • Sure will do, if I dont find a way to update using Name instead of Code.
    – vikas112
    Sep 24, 2015 at 12:01
  • In my scenario, I need to do this using Name instead of code.
    – vikas112
    Sep 24, 2015 at 12:12
-1

Solution is as follows.

            <RecordType xsi:type="sf:RecordType">
                <Name>Test1</Name>
            </RecordType>

Where RecordType comes from datamodel - relationshipName: RecordType

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .