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
jiri1.3966104396934639E12jiri1.3966104396934639E12 

INVALID_TYPE_ON_FIELD_IN_RECORD for integer value

Hi,

I'm trying to do upserts progrmatically.  For some reason I'm getting an INVALID_TYPE_ON_FIELD_IN_RECORD error for integer fields.
For example 5267 is reported as invalid value for field PaperID__c (see below).

I¨m quite buffled by this.



<?xml version="1.0" encoding="UTF-8"?><soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Header><sforce:SessionHeader xmlns:sforce="urn:partner.soap.sforce.com"><sessionId xsi:type="xsd:string">00Dg0000003LRFz!ARAAQGWdG_dr.Ia_2V3QWeFZb7jWZJkn23A905ygVgvCN8_6MjC8aaqrBujiH4Gtp0_wUKzWW8HDr4CeIjqsOjaiobVp6VhH</sessionId></sforce:SessionHeader></soap:Header><soap:Body><sforce:upsert xmlns:sfons="urn:sobject.partner.soap.sforce.com" xmlns:sforce="urn:partner.soap.sforce.com">

      <sforce:externalIDFieldName xsi:type="xsd:string">PaperID__c</sforce:externalIDFieldName>
      <sObjects xsi:type="sforce:Account">

         <sforce:PaperID__c xsi:type="xsd:int">5267</sforce:PaperID__c>
       
        <sforce:name xsi:type="xsd:string">Test test5eeerreedede</sforce:name>
        <sforce:type xsi:type="xsd:string">0</sforce:type><sforce:fieldsToNull xsi:type="xsd:string">website</sforce:fieldsToNull>
        <sforce:fieldsToNull xsi:type="xsd:string">country__c</sforce:fieldsToNull>
        <sforce:fieldsToNull xsi:type="xsd:string">papertype__c</sforce:fieldsToNull></sObjects>
    </sforce:upsert></soap:Body></soap:Envelope>
Ramu_SFDCRamu_SFDC
Hi, replace "xsd:int" to "xsd:integer" hope that will fix the problem.


SuperfellSuperfell
Custom number fields are xsd:double or xsd:decimal not xsd:int. check what the wsdl says the field type is.