• Bob Barracca
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Does anyone know how to list cases for a given account?  If you look at the XML schema for the case object, it includes an AccountId field, but that field is not visable through the API. 

I am using WWW::Salesforce from Perl and when I try to run this:

    my $casequery = "select Id, CaseNumber from Case where AccountId = '$sfid'";
    my $caseresult = $sf->query('query' => $casequery);

I get:

    No such column 'AccountId' on entity 'Case'.

Any help would be greatly appreciated.

Thanks,
Bob
Greetings All,

I am trying to update accounts using the WWW::Salesforce module in Perl, but I am not having any success.  I am able to query successfully and get results.  I can execute update commands without seeing errors, but the records never update.  For example:

-----------------------------
use WWW::Salesforce::Simple;
use SOAP::Lite;

print "Connecting to salesforce...\n";
my $sf = WWW::Salesforce->login( username => 'XX', password => 'XX' );
print "  Done.\n";

$sf::Constants::TYPES{Account}->{Account_Export__c} = 'xsd:boolean';

my $query = "SELECT id,Name,account_export__c, business_id__c, billingstate FROM Account WHERE id = '0014000000GNmKmAAL'" ;

print "Running query...\n";
my $result = $sf->query('query' => $query);
print "Loop results\n";

foreach my $elem ($result->valueof('//queryResponse/result/records'))
{
    @idstring = map{$_}(@{$elem->{id}});
     my ($id1, $id2) = splice(@{$elem->{Id}},0,2);
    print "QUERY RESULT: $elem->{id} $id1 : $elem->{Name} :  $elem->{BillingState}  : $elem->{Business_ID__c} : $elem->{Account_Export__c}\n";
   
    $uphash{type} = "Account";
    $uphash{id} = $id1;
    $uphash->{Name} = "WLV - Parasol Bar";
    $uphash->{"Account_Export__c"} = false;
   
    $upres = $sf->update(%uphash);
    print "UPDATE RESULT: $upres \n";
   
}

print "    Done.\n";


------

Here is the script output:
Connecting to salesforce...
  Done.
Running query...
Loop results
QUERY RESULT: ARRAY(0x1cd4ec8) 0014000000GNmKmAAL : Parasol Bar :  NV : a1234 : true
UPDATE RESULT: 1
    Done.

-------

So the update command returns 1, but the record does not actually get updated.  I have also tried hardcoding the id just for testing like this:
$uphash{id} = "0014000000GNmKmAAL";

because a number of posts I saw revolved around bad Ids, but it still does not work.  I am connecting as a Salesforce Administrator user and I checked all my rights so that should not be an issue.

Any assitance would be greatly appreciated.

Thanks,
Bob


Greetings All,

I am trying to update accounts using the WWW::Salesforce module in Perl, but I am not having any success.  I am able to query successfully and get results.  I can execute update commands without seeing errors, but the records never update.  For example:

-----------------------------
use WWW::Salesforce::Simple;
use SOAP::Lite;

print "Connecting to salesforce...\n";
my $sf = WWW::Salesforce->login( username => 'XX', password => 'XX' );
print "  Done.\n";

$sf::Constants::TYPES{Account}->{Account_Export__c} = 'xsd:boolean';

my $query = "SELECT id,Name,account_export__c, business_id__c, billingstate FROM Account WHERE id = '0014000000GNmKmAAL'" ;

print "Running query...\n";
my $result = $sf->query('query' => $query);
print "Loop results\n";

foreach my $elem ($result->valueof('//queryResponse/result/records'))
{
    @idstring = map{$_}(@{$elem->{id}});
     my ($id1, $id2) = splice(@{$elem->{Id}},0,2);
    print "QUERY RESULT: $elem->{id} $id1 : $elem->{Name} :  $elem->{BillingState}  : $elem->{Business_ID__c} : $elem->{Account_Export__c}\n";
   
    $uphash{type} = "Account";
    $uphash{id} = $id1;
    $uphash->{Name} = "WLV - Parasol Bar";
    $uphash->{"Account_Export__c"} = false;
   
    $upres = $sf->update(%uphash);
    print "UPDATE RESULT: $upres \n";
   
}

print "    Done.\n";


------

Here is the script output:
Connecting to salesforce...
  Done.
Running query...
Loop results
QUERY RESULT: ARRAY(0x1cd4ec8) 0014000000GNmKmAAL : Parasol Bar :  NV : a1234 : true
UPDATE RESULT: 1
    Done.

-------

So the update command returns 1, but the record does not actually get updated.  I have also tried hardcoding the id just for testing like this:
$uphash{id} = "0014000000GNmKmAAL";

because a number of posts I saw revolved around bad Ids, but it still does not work.  I am connecting as a Salesforce Administrator user and I checked all my rights so that should not be an issue.

Any assitance would be greatly appreciated.

Thanks,
Bob