• InterceptTechie
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
Hi Everyone,

I'm having a pretty basic problem but I hope someone can assist me with.  I've added a second lookup field to the Opportunity object called "Client_Account_NameId__c" which is related to the Account object.  This is basically the same relationship as the default "Account" field of the Opportunity object.

I'm trying to find the owner of this lookup field in an s-control and whenever I try it, my code breaks.  Below is the a snippet of the related code:

Code:
var result1 = sforce.connection.query("Select OwnerId from Account where Id ='{!Opportunity.Client_Account_NameId__c}'");
var records1 = result1.getArray("records");

var result2 = sforce.connection.query("Select FirstName, LastName from User where Id =records5[0].OwnerId");
var records2 = result2.getArray("records");

var owner = records2[0].FirstName + " " + records2[0].LastName;

 
I'm able to get back the OwnerId but I can't seem to test if any data is being collected from the User table.  I've also tried $User because that was used in other examples I've found but that didn't work either.

I'm positive this is not the best approach to get this data either so any suggestions are welcome.

Thanks alot for your help

Hello,
 
I am using the SalesForce.pm module, which has worked great, but I need to bring in deleleted records now too.  The API method queryAll() supports that, but the SalesForce.pm module doesn't seem to recongnize it.
 
Is there a newer version vailable that supports that method?  I can't seem to find it.
 
thank you!
Hello,
 
I am using the SalesForce.pm module to pull down some data using the API.  I want to store the SalesForce ID (which is a character field), but when I read the value using the perl API, I get the Id values back as:  ARRAY(0x35b8370), etc.
 
I'm using the example code from another post to hit the api and populate an array to return the data, such as:
 
Code:
my @records = QuerySF("select * from Opportunity");
foreach my $rec (@records)
{
      print "$rec->{Id}";
}

sub QuerySF 
{ 
 my $soql = shift;  
 my $lim = '2000'; 
 my $q = $sf->query( query =>$soql, limit => $lim );
 my @trans = $q->valueof('//records');
  
 while ( 'false' eq $q->valueof('//done') ) 
 { 
  # query more
  $q = $sf->queryMore( queryLocator => $q->valueof('//queryLocator'), limit => $lim ); 
  my @more = $q->valueof('//records');
  push @trans, @more;
 } 
 return @trans;
}

 
any ideas?  I'm fairly new to Perl, so perhaps I'm missing something.
 
thank you!

 
Hi Everyone,

I'm having a pretty basic problem but I hope someone can assist me with.  I've added a second lookup field to the Opportunity object called "Client_Account_NameId__c" which is related to the Account object.  This is basically the same relationship as the default "Account" field of the Opportunity object.

I'm trying to find the owner of this lookup field in an s-control and whenever I try it, my code breaks.  Below is the a snippet of the related code:

Code:
var result1 = sforce.connection.query("Select OwnerId from Account where Id ='{!Opportunity.Client_Account_NameId__c}'");
var records1 = result1.getArray("records");

var result2 = sforce.connection.query("Select FirstName, LastName from User where Id =records5[0].OwnerId");
var records2 = result2.getArray("records");

var owner = records2[0].FirstName + " " + records2[0].LastName;

 
I'm able to get back the OwnerId but I can't seem to test if any data is being collected from the User table.  I've also tried $User because that was used in other examples I've found but that didn't work either.

I'm positive this is not the best approach to get this data either so any suggestions are welcome.

Thanks alot for your help

Hello,
 
I am using the SalesForce.pm module, which has worked great, but I need to bring in deleleted records now too.  The API method queryAll() supports that, but the SalesForce.pm module doesn't seem to recongnize it.
 
Is there a newer version vailable that supports that method?  I can't seem to find it.
 
thank you!
Hello,
 
I am using the SalesForce.pm module to pull down some data using the API.  I want to store the SalesForce ID (which is a character field), but when I read the value using the perl API, I get the Id values back as:  ARRAY(0x35b8370), etc.
 
I'm using the example code from another post to hit the api and populate an array to return the data, such as:
 
Code:
my @records = QuerySF("select * from Opportunity");
foreach my $rec (@records)
{
      print "$rec->{Id}";
}

sub QuerySF 
{ 
 my $soql = shift;  
 my $lim = '2000'; 
 my $q = $sf->query( query =>$soql, limit => $lim );
 my @trans = $q->valueof('//records');
  
 while ( 'false' eq $q->valueof('//done') ) 
 { 
  # query more
  $q = $sf->queryMore( queryLocator => $q->valueof('//queryLocator'), limit => $lim ); 
  my @more = $q->valueof('//records');
  push @trans, @more;
 } 
 return @trans;
}

 
any ideas?  I'm fairly new to Perl, so perhaps I'm missing something.
 
thank you!