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
thvvthvv 

Perl error when updating record

I am adapting Tony Stubblebine's example to do a simple update of a Lead record.
I can query the database, and insert new records.  When I attempt to update a
record that's there already, I get the message

  Expected a hash with key 'type' as first argument at soaptest6.pl line 49

from the statement
    $sfresult = $sforce->update(%lead);

I dumped out the hash: it has a key "type" which I inserted first, but it's a hash, right, the keys come back in random order, and PostalCode comes back first. 

I must be missing something simple.  Clue please.

iti-commsiti-comms
Poor documentation on my part accounts for this error.  The proper syntax is:

my $res = $sforce->update( type=>'Account', \%one_item, \%two_item, \%n_item );

or optionally,

my $res = $sforce->update( type=>'Account', @array_of_hash_refs );

There is a lot of work being done at the moment to update the very old Perl API that was written to have it work like the Salesforce API documentation says it should.  Many things will change when the 0.1 release of WWW::Salesforce is let loose upon the CPAN world.  0.1 will be the first release towards a 1.0 release that works exactly as the Saleforce documentation says.

Thanks,
Chase
PerlPerl
Hi
 I am newbie to salesforce, We are trying to connect to salesforce from PERL , we did the coding but we are getting the following error when executing the code
"500 Server closed connection without sending any data back at //pkgs/linux/intel/perl/5.8.8.rhas3.x86/lib/site_perl/5.8.8/WWW/Salesforce.pm line 469"
There is no issue with the user id and password we used , we are able to login to the portal and we are able to ping the site from the unix box.If you have already connected to the portal could you tell me the steps you followed to connect .
Do we need to  use the wsdl file for PERL also , if yes where should i keep the file
Thanks,
Prasanna