Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Perl, PHP, Python & Ruby Development
- :
- Value doesn't match the required type (Perl)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Value doesn't match the required type (Perl)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-30-2012 03:03 AM
I'm new to salesforce and it seems I'm overlooking something obvious because I can't find any other thread with this problem:
Created a user-defined field "External_ID" in "Leads", type integer (8,0). Now I want to create a new lead with WWW::Salesforce::Simple
my $row->{id} = int(12);
my %lead = (type => "Lead",
External_ID__c => $row->{ID}, # <-- Doesn't work for me --
Company => $row->{CNAME},
LastName => $row->{LNAME},
NumberOfEmployees => 12 # <-- That works! Same type but system field, not user-defined --
#...and so on...
);
But I'm getting the error message "Value doesn't match the required field type" (something like this - translated from german).
I'm submitting an integer value and the field is integer. What am I doing wrong?
Also replaced the $row->{ID}-variable with 12 and "12" (with and without quotes) - all the same error message.
Changed the field type to string but it doesn't accept "12" as well. Interestingly it accepts "abc" as expected.
Actually this value comes from a database like all other values and it's also definitively an integer value in the database but didn't worked either. So that's why there's that line my $row->{id} = int(12) ;-)
What else can I do to save an integer value in an integer field?
Setting NumberOfEmployees to 12 curiously works. That's also an integer field and I'm ging an integer value, but it's a system field and no user-defined field.
I would suggest that something's wrong with that user-defined field. But there's not much I can adjust. I can adjust that it's integer and that there may be up to 8 digits. Doesn't seem to be a big source of errors...
Solved! Go to Solution.
Re: Value doesn't match the required type (Perl)
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-31-2012 08:31 AM - edited 07-31-2012 08:31 AM
Okay, stumbled upon the solution by trying to clarify another question. Seems to be a problem of WWW::Salesforce::Simple.
Already discussed here but wasn't able to find it because I've searched for terms like "custom field" and "field type" :-/
So I just had to prebend the line
WWW::Salesforce::Constants->register_type("Lead", "External_ID__c", "xsd:double");
now it works like expected.

