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
nhnh 

Perl API - Data Issues - Text/Numeric fields

I found a problem when trying to create some 'text' fields that should only hold numeric values.

For example - PostalCode.   I try and set with a Zip code, and get:

    <errors>
     <fields xsi:null="true"/>
     <message>Value 12563 not of required type string on field PostalCode</message>
     <statusCode>INVALID_TYPE_ON_FIELD_IN_RECORD</statusCode>
    </errors>

I get the same error on other 'text' fields that need a numeric value.  I found a work around by adding a 'space' character to the end of the string but assume this is something that needs to get fixed.

Thanks

Nigel

 


 

Ron HessRon Hess

it should work if you specify the type as string, the parser tries to guess the encoding type unless one is specified and a numeric gets turned into a number.

i use

field => $sf->type('string',$var)

nstead of

field => $var

to ensure that the serializer knows what type i intend.