• jrose
  • NEWBIE
  • 0 Points
  • Member since 2009

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

New to this so appologies if I'm doing something stupid.

 

Running the following:

 

use strict;
use WWW::Salesforce::Simple;


# Authenticate with the Salesforce

 

my $sforce = WWW::Salesforce::Simple->new(
        'username' => '*****',
        'password' => '*****'
) or die 'failed sf login'.$!;

my %lead=();

%lead = (
        'email' => 'testtestcom',
        'leadsource' => 'WebRegistration',
        'company' => 'TestCo',
        'country' => 'US',
        'firstname' => 'Test',
        'lastname' => 'Person'

);

my $result = $sforce->create(type => 'lead',%lead);

 

 

and get the error: 

> Missing entity type information. sObject requires a separate 'type' field be sent. at sf2.pl line 30

 

Any ideas?

 

While I'm at it, are there any decent docs on using Perl with salesforce with code examples of queries ,inserts & creates etc? There doesn't seem to be much around.

 

Thanks in advance.

 

G

Here is part of the subroutine:

        my $self       = shift;
        my $changelist = shift;
        my $sObject_type = 'ADM_Work__c';

        if( $self->{_p4status} eq $GUS::OPEN_ONCE ) {

            print "\n\n ----------------------------------------------------------------------\n";
            print "$sObject_type, id => " . $self->{_id} . ", Perforce_Status__c => $GUS::NONE)";
            print "\n\n ----------------------------------------------------------------------\n";

            my $result = $self->{_sfdc}->update(type => $sObject_type, id => $self->{_id}, Perforce_Status__c => $GUS::NONE);
           
            if ($result->valueof("//updateResponse/result/success") ne 'true') {
                # log problem here
                print "unable to update p4 status";
            } else {
                $self->{_p4status} = $GUS::NONE;
            }
       
Here is the output:
 ----------------------------------------------------------------------
ADM_Work__c, id => a0HT0000000KIZbMAO, Perforce_Status__c => --None--)

 ----------------------------------------------------------------------

Type looks to be getting set from the print statement output??