You need to sign in to do that
Don't have an account?
Help to fix do_query UNSUPPORTED_API_VERSION on semi joins
The person who set this up is no longer with the company. I need to programatically query/extract some info from SalesForce so I can backload into Oracle or MySql (so to csv).
Trying to use a semi-join to filter out some Contacts to reduce rows of data. Filter the contacts Id to a list of values from custom field in a custom object (should be so simple.... )
Get error about teh semi-join not being valid in current version.
How do I identify the version installed and more importantly how can I fix this?
(btw all relationships are 'lookups' so i'm not having too much luck with selecting combined object info.. have to exort each object indifividually)
Thank you.
here's what I've found...
WWW::Salesforce::Simple
my $sf = WWW::Salesforce::Simple->new( username => $sf_id, password => $sf_pw );
my $query ="Select Id, AccountId, LastName, FirstName, Salutation, Name, Email, Title, OwnerId FROM Contact WHERE Id IN (SELECT Channel_Partner_Manager__c FROM Office_Profile__c WHERE Lead_Source__c = 'Channel Partner' and Source_Detail__c = 'xxx123')";
my $res = $sf->do_query( $query );
UNSUPPORTED_API_VERSION:
Title, OwnerId FROM Contact WHERE Id IN (SELECT Channel_Partner_Manager__c
^
ERROR at Row:1:Column:157
Semi joins are not supported in this version of the API at ./force-get-test.pl line 127
Can't call method "fault" without a package or object reference at
/usr/lib/perl5/site_perl/5.8.8/WWW/Salesforce/Simple.pm line 42 (#4)
(F) You used the syntax of a method call, but the slot filled by the
object reference or package name contains an expression that returns a
defined value which is neither an object reference nor a package name.
Something like this will reproduce the error:
$BADREF = 42;
process $BADREF 1,2,3;
$BADREF->process(1,2,3);
Uncaught exception from user code:
Can't call method "fault" without a package or object reference at /usr/lib/perl5/site_perl/5.8.8/WWW/Salesforce/Simple.pm line 42.
at /usr/lib/perl5/site_perl/5.8.8/WWW/Salesforce/Simple.pm line 42
WWW::Salesforce::Simple::do_query('WWW::Salesforce::Simple=HASH(0x9b2e1ec)', 'Select Id, AccountId, LastName, Fi...') called at
date of the Simple.pm is from 2009 although it looks like this directory tree was updated in April...
Thank you.
I downloaded the Sample.pm package and took a look at how it is connecting. If you open up Salesforce.pm in the WWW:Salesforce package you will see a number of variables defined with a $SF prefix. The $SF_PROXY one designates the endpoint for the SOAP connection. In the version of the package I downloaded from CPAN (Salesforce.pm says it's version 0.15) it is set to 8.0. As you will note from my earlier message, this is very out of data and does not support the query you are attempting to make. Simply updating the version, as indicated in my previous message, MAY help.
The error message you are seeing from the query call indicates that the query threw an error which was not caught. As a result, the variable $r is undefined and you cannot call a method (fault) on an undefined variable.
Park
All Answers
You need to update the service endpoint URL to a version in which this syntax is supported. I can't recall what that was, but anything over 20 should be fine.
Look for https://www.salesforce.com/services/Soap/u/XX.X and set the XX.X to 20.0 or 24.0
If you are using a WSDL file it will be in there, at the end, otherwise it will probably be in the package code. Sorry, I don't use the PERL package so I can't say for sure. If you are using a WSDL file, generating a new one will also resolve the problem and would be the preferred solution.
All of this depends on the version of the package supporting the result returned by the join syntax.
Park
Hello,
Thank you for the information. However it does not appear that the script is using the WSDL.
I believe it has something to do with perl/and the simple package as the error is
Can't call method "fault" without a package or object reference at /usr/lib/perl5/site_perl/5.8.8/WWW/Salesforce/Simple.pm line 42.
at /usr/lib/perl5/site_perl/5.8.8/WWW/Salesforce/Simple.pm line 42
Just need some direction as to where I might find an updated version /toolkit that has some instructions on how to upgrade what's there..
I downloaded the Sample.pm package and took a look at how it is connecting. If you open up Salesforce.pm in the WWW:Salesforce package you will see a number of variables defined with a $SF prefix. The $SF_PROXY one designates the endpoint for the SOAP connection. In the version of the package I downloaded from CPAN (Salesforce.pm says it's version 0.15) it is set to 8.0. As you will note from my earlier message, this is very out of data and does not support the query you are attempting to make. Simply updating the version, as indicated in my previous message, MAY help.
The error message you are seeing from the query call indicates that the query threw an error which was not caught. As a result, the variable $r is undefined and you cannot call a method (fault) on an undefined variable.
Park
Hello Park,
Thank you for your additional information (and patience). The salesforce upsert/export was set-up by someone no longer with the company and we (Tom/Susan) have recently inherited this. Changing the version as you'd described fixed the select.
However, it's my/our opinion that we ought to find/figure out the correct way to download and apply the update for the current version.
(If you have a good link to the basic documentation that would be greatly appreciated).
Thank you again for your input.
I'm glad you were able to resolve your problem, and thanks for acknowledging the solution. The PERL toolkit does not appear to be actively maintained. Version 0.15 looks to be the most current. It has little or no support for features implemented since version 8 of the Salesforce API. I do not believe that there is anything more that you can do other than updating the toolkit yourself or switch to another language with a more active Salesforce developer community.
Park