• paololim
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

Hi There,

 

First time on this board so sorry if this problem has been posed before.  There are a few threads detailing upsert, but no sample code for working stuff in Perl's WWW::Salesforce library.  Here is what I have so far:

 

 

my %account; $account{"type"} = "Account"; $account{"FirstName"} = "NewFirstname"; $account{"LastName"} = "NewLastname"; $account{"RecordTypeId"} = $rti; $account{"My_ID__c"} = $my_id; $result = $sforce->upsert((type => "Account"), "My_ID__c","", (%account)); if ($result->result->{"success"} eq "false") { print $result->result->{errors}->{message} . "\n"; }

 

The reason I have the following as my upsert function: 

$sforce->upsert((type => "Account"), "My_ID__c","", (%account))

 

Is becase it's the only one that does not complain of missing types, keys, etc.  So anyway, when I run my Perl script, I get the following:

 

       Account: bad field names on insert/update call: type

 

What am I doing wrong with my code?  Can someone give me a simple example of how upsert should be used in Perl?

 

Thanks!