• tonyk
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I can't seem to get past the basics, spending lots of time on this. Just want to get one query to work with some pointers to the correct documentation and I'm off doing something useful.

Starting with:



use Salesforce;

my $user="bubba\@gmail.com";
my $pass="SusaniscoolRfA44QuF7I97QlJr0KEQDV2js";

my $service = new Salesforce::SforceService;
my $port = $service->get_port_binding('Soap');
$port->login('username' => $user,'password' => $pass)
|| die "Could not login to salesforce.com";

my $result = $port->query("select FirstName, LastName from Contact",100);
print "$result\n";
print "We got " . $result->valueof('//queryResponse/result/size') . " back.\n";



Returns this:



C:\Perl Files\SFDC>test.pl
1
Use of uninitialized value in concatenation (.) or string at C:\Perl Files\SFDC
test.pl line 20.
We got back.



Now this makes me quite curious where the //queryResponse/result/size is coming from. Is there a doc that explains these elements? I have not located yet.

This does not work either:


foreach my $elem ($result->valueof('//queryResponse/result/records'))
{
printf "%s, %s\n", $elem->{Id}[0],$elem->{AccountId};


And I really don't mean to be negative demonstrating all that does not work but apparently Perl is still quite challenged here.

At the end of the day, if one exists. I would like to simply insert some leads and associate a task with them so the sales folks get a nice alert. I can do this with the loader and spreadsheets but it is a pretty manual process. If you can point me to some working scripts, pretty much -anything- that actually works I would be most grateful.

I must say this is the coolest and most flexible service I have encountered, just need a little help from my friends.

Regards,

Jacksonp2008@gmail.com