You need to sign in to do that
Don't have an account?
paradise
Strange error: Expected a hash with key 'type' as first argument
Hi all salesforce experts,
need your help.
In my perl script (using WWW.Salesforce-0.083 module), login and select succeeds, but update operation fails.
Here is my perl codes:
my $sforce = WWW::Salesforce::Simple->new(username,password); #succeeds
my $result = $sforce->do_query("select ....."); #succeeds
.............
my %update_Hash;
$update_Hash{type} = "Account";
$update_Hash{Id} = "0017000000LKqSuAAL"; #a real ID gotten from query
$update_Hash{"Site"} = "Testing sites";
my $res = $sforce->update(%update_Hash); #fails here with error message "Expected a hash with key 'type' .....
print "Update result = $res\n";
Why ?
How to solve ?
$objType = "object_name"; #or maybe "my_object_name__c"
$result = $sforce->update(('type' ,$objType),%data);
#%data is the hash with attribute value pairs for the object.
# This forces the 'type' entry to be the first one in the hashtable
HTH
-Joe