• dhruva
  • 5 Points
  • Member since 2004

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
  • 58
Every now and then I see this error:
500 read failed: at Salesforce.pm line 80

recorded in my error capture file. That specific line reads:

my $r = $client->query($self->get_session_header(),
SOAP:ata->name('query' => $in{'query'}),
SOAP::Header->name('QueryOptions' => \SOAP::Header->name('batchSize' => $in{'limit'})));

(I think I've slightly modified it from the original Salesforce.pm.)

Any ideas why this might be happening? It's intermittent, so it's clearly not a syntax error or something like that.
  • September 28, 2005
  • Like
  • 0
I'm developing an application that provides several links into a customer's SFDC database. Unfortunately, I've found at least two versions of links:
https://na1.salesforce.com/... and https://ssl.salesforce.com/...

And if we provide the wrong type of link, the customer is forced to re-login for each link. Any way I can determine the right domain through the API, so I can reliably provide the right link?

  • September 27, 2005
  • Like
  • 0
I'm trying to run a retrieve and finding that some of the fields are not returned. Completely stumped.

Background: I'm using Salesforce.pm and Perl. Using Data Dumper on the call and response gives:
$VAR1 = {
'fields' => 'Id,AccountId,OwnerId,email_notification__c,Languages__c,Level__c',
'ids' => [
'type' => 'Contact'

$VAR1 = bless( {
'Id' => '00330000001lzUPAAY',
'AccountId' => '001300000018DA1AAM',
'OwnerId' => '00530000000cIpFAAU',
'Languages__c' => 'English',
'Level__c' => 'Primary'
}, 'Contact' );

Notice that email_notification__c is not returned. Neither is it returning a fault along the lines of "Invalid field". It just calmly returns some but not all.

Any ideas?
Yes, that fun internationalization topic again. I'm struggling with this one.

Some background: perl script using query method from Salesforce.pm.

The query: select Id from Contact where (Email='junk@junk.com' or (FirstName='test' and LastName='Pérez'))

That last name seems to be the trouble. I get back the following fault string:
MALFORMED_QUERY: malformed query: unexpected token: (followed by what seems to be the sessionID).

And yes, I am doing:
my $last_name = Encode::encode_utf8($_[2]);
($_[2] is the last name)

If I don't use encode_utf8, I get the following Perl error:
Wide character in subroutine entry at [perl directory]/SOAP/Lite.pm line 129, which is the base64 subroutine. Poked around the web and found this:
but that didn't really seem to help. At least, I couldn't figure out how to make it help.

Any ideas? Not sure about this one, but it seems to only happen on the query. I know I have sent utf-8 characters to the update method.
We have noticed a lot of variable times for our API calls and we are trying to determine whether this is related to just simply server load or whether it is also related to Internet traffic. e.g. if a company is headquartered in Europe, is it likely that their API servers are also in Europe? And since our API calls originate in the US West Coast, how much impact will this have on the call-response times? Is there a way to force the API to look at a US copy of the database?

The particular calls we are talking about are xml-rpc calls, but I don't think that should make a difference. Right?

Anybody else pondered this question and found any answers?
  • April 28, 2005
  • Like
  • 0
I am trying to update the task using the API .
I am creating the fields like this
$createFields = array (
  'ActivityDate' =>$Task_date,
        'Priority' =>'Normal',
        'Status' => 'Not Started',
        'Description' => $_POST['task_logacall'],
        'Subject' => $_POST['task_subject'],
        'WhatID' => $_POST['policy_id'],
  'OwnerId' => $_SESSION['Id']
Now its creating the new task but when I add the user Id in lastModifiedID its not creating the task and also not throwing any error, The code is
$createFields = array (
  'ActivityDate' =>$Task_date,
        'Priority' =>'Normal',
        'Status' => 'Not Started',
        'Description' => $_POST['task_logacall'],
        'Subject' => $_POST['task_subject'],
        'WhatID' => $_POST['policy_id'],
  'OwnerId' => $_SESSION['Id'],
LastModifiedById=> $_SESSION['Id']
$task_result = $ssuUtility->createTask($createFields);
The createTask Functions looks like this
public function  createTask($fields) {
    $contactSObject = new SObject();
    $contactSObject->type = 'Task';
    $contactSObject->fields = $fields;
    $createContactResult = $this->mySforceConnection->create(array($contactSObject));
    return $createContactResult;
the $_SESSION['Id'] i am getting by querying the User__c object. Its updating the owner Id but not the lastmodifiedId, which changes the name of the person who last modified it.
Please let me know what is going wrong here. Or is that I cannot change the LastModified Person name by updating LastModifiedById using Session_Id from user__c object
I was able to retrieve all records from Lead object earlier(with 80k) . But now, my lead size grown upto 500k records. I'm getting the following error. Your help is very much a apprectiated
My code snippet:
   String sql="SELECT "+<<all_columns_from_lead_object>>+" FROM Lead"
   QueryResult queryResult = binding.bind().query(sql);
   while (true) {
    SObject[] sObjs = queryResult.getRecords();
    if (sObjs==null || sObjs.length==0) {
    //Begin: retrieving sObjs and storing into csvfile && our biz logic here..
    //End: retrieving sObjs and storing into csvfile && our biz logic here..
    if (queryResult.isDone()) {
    } else {
     queryResult = binding.bind().queryMore(queryResult.getQueryLocator());
  }catch (Exception e) {
ERROR 2007-06-14 11:27:06,190 (SFCampaignMemberBO.java:924) - Unable to execute doSelect
 faultCode: {urn:fault.partner.soap.sforce.com}INVALID_QUERY_LOCATOR
 faultString: INVALID_QUERY_LOCATOR: invalid query locator
 {urn:fault.partner.soap.sforce.com}fault:<ns1:exceptionCode>INVALID_QUERY_LOCATOR</ns1:exceptionCode><ns1:exceptionMessage>invalid query locator</ns1:exceptionMessage>
INVALID_QUERY_LOCATOR: invalid query locator
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
 at java.lang.reflect.Constructor.newInstance(Unknown Source)
 at java.lang.Class.newInstance0(Unknown Source)
 at java.lang.Class.newInstance(Unknown Source)
 at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:104)
 at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:90)
 at com.sforce.soap.partner.fault.InvalidQueryLocatorFault.getDeserializer(InvalidQueryLocatorFault.java:85)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.axis.encoding.ser.BaseDeserializerFactory.getSpecialized(BaseDeserializerFactory.java:154)
 at org.apache.axis.encoding.ser.BaseDeserializerFactory.getDeserializerAs(BaseDeserializerFactory.java:84)
 at org.apache.axis.encoding.DeserializationContext.getDeserializer(DeserializationContext.java:464)
 at org.apache.axis.encoding.DeserializationContext.getDeserializerForType(DeserializationContext.java:547)
 at org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(SOAPFaultDetailsBuilder.java:157)
 at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
 at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
 at javax.xml.parsers.SAXParser.parse(Unknown Source)
 at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
 at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
 at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
 at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2812)
 at org.apache.axis.client.Call.invoke(Call.java:2795)
 at org.apache.axis.client.Call.invoke(Call.java:2461)
 at org.apache.axis.client.Call.invoke(Call.java:2384)
 at org.apache.axis.client.Call.invoke(Call.java:1830)
 at com.sforce.soap.partner.SoapBindingStub.queryMore(SoapBindingStub.java:1743)
 at responsys.sf2ri.model.bo.SFCampaignMemberBO.selectSfDataAsCSVFile(SFCampaignMemberBO.java:915)
 at responsys.sf2ri.model.bo.RIEtlBO.mergeDataIntoSfLeadOrContactTableForAutomationJob(RIEtlBO.java:2528)
 at responsys.sf2ri.model.bo.Sf2RiAutomationWorker.uploadSfContactsNLeadsDataForAutomationJob(Sf2RiAutomationWorker.java:2137)
 at responsys.sf2ri.model.bo.Sf2RiAutomationWorker.transferAllLeadsNContacts(Sf2RiAutomationWorker.java:238)
 at responsys.sf2ri.model.bo.Sf2RiAutomationWorker.run(Sf2RiAutomationWorker.java:2459)
 at java.lang.Thread.run(Unknown Source)
  • June 14, 2007
  • Like
  • 0
I'm new to Salesforce development and have been tasked with a project that everyone thinks is doable, but I can't seem to find the right solution.
I'm developing for a third party where leads would be sent to different SF accounts. I will not have the username and password for the different accounts. I will have the SF login email address only. Based on that it seems that the API solution is no longer viable unless I missed something somewhere. I started looking into the Web to Lead. It appears that the OID is the unique value on the form. General SF users will not know how to retrieve this number from the html. I would like to use the SF email address as the key, is there any way to do so?
The second hurdle that I've run into are the fields on the Lead form. I would like to create my own format with a custom object and then submit the lead in the custom object format.
I'm looking for any assistance on this. With all of the development tools, there's got to be a way to accomplish these things.
Thanks in Advance.
Is there a time limit as to how long a querymore locator/cursor will live even if I'm actively calling it to get additional records?

I am trying to retrieve about a million records which takes 5+ hours and am getting the error below around 5 hours in:

UNKNOWN_EXCEPTION: An unexpected error occured. Please include this ErrorId if you contact support: 1266558833-34

  • October 30, 2006
  • Like
  • 0
i need to assign new leads to certain queue 's using web to lead - each queue should have his own ID (such as 33, numeric value) and I should create different links for each queue.  When the queue link is clicked, that lead should be assigned to that queue.  Seems easy, but I cannot figure it out.  Any help would be greatly appreciated I feel the answer is staring me right in the face.

Where should I look into if I get "INVALID_CROSS_REFERENCE_KEY" on the error back?
  • June 19, 2006
  • Like
  • 0
I've been having some trouble wrapping my head around this one. Hope someone can help. I'd really appreciate the help.

I want to reliably iterate ove the responses from my queries. Not sure how I'd do that when the URL for the results are different for query (//queryResponse/result/records') and querymore (//queryMoreResponse/result/records').

Can someone help me out with some sample code? I've been trying to translate the c++ code provided in the API doc to perl without any luck. This one doesnt work.

$r = $sf->query('query' => "select Id from Case" );
$numrecords = $r->valueof('//queryResponse/result')->{size};
my $done = "false";
if ( $numrecords > 0 ) {
        while ( uc($done) eq "FALSE" ) {
                foreach $elem ( $r->valueof('//queryResponse/result/records') ) {
                        print $elem->{Id}[0]."\n";
                $done = $r->valueof('//queryResponse/result')->{done};
                if ( uc($done) eq "FALSE" ) {
                        $r = $sf->queryMore( 'queryLocator' => $r->valueof('//queryResponse/result')->{queryLocator} );
                        $numrecords = $r->valueof('//queryMoreResponse/result')->{size};
                        foreach $elem ( $r->valueof('//queryMoreResponse/result/records') ) {
                                print $elem->{Id}[0]."\n";
                } else {
                        $done = $r->valueof('//queryResponse/result')->{done};
} else {
        print "No records match criteria\n";

Message Edited by sk2006 on 05-23-2006 06:04 AM

I have a page on my site where people can select which white papers they want to download. We want to have the links emailed to them, and we want to have a record of which white papers they downloaded in their lead record.
Is there a way to have an email generated with the subject lines of the selected white papers hotlinked? Or something similar that allows for a dynamic email that includes links to only white papers they selected?
  • April 19, 2006
  • Like
  • 0
Hi all,

I am wondering if the following is safe to assume always true.

http://*.salesforce.com/{Id} to reference a particular record in the database?
  • April 03, 2006
  • Like
  • 0

In my application I associate opportunities with opportunities in sales force. I would like to add a link, when the user clicks on it, I open a browser window that goes to sales force and after the user enters credentials is forwarded to that Opp. page. I know this is possible, is there a certain format for the URL link? Is there a place where I can get information for these kind of tasks?


I'm trying to POST to WebToLead service through the servlet http://www.salesforce.com/servlet/servlet.WebToLead however I do not seem to beable to get the thing to work. The HTML generated from salesforce.com works fine, then I would presume posting the same information as in the form to http://www.salesforce.com/servlet/servlet.WebToLead would also work but no leads are generated in salesforce.com.

Has anyone got this to work from PHP? Has anyone got some working example code?

p.s. I do not want to use the API.

Thanks for your time
Does anyone know if there is a way to use the saleforce "id" value to input into salesforce instead of the "name" value (or any other value rather than the name). I want to validate a form I created with custom fields but I don't want to use the assigned number they gave to it.

For example, when a user submits the form, a pop-up box comes up and says "00N00000006pBHe is required". I'd rather it say "Your Name is required" but when I change the name value to read "your name" instead of "00N00000006pBHe" it doesn't get captured into salesforce.

Message Edited by ccutlerbrown on 02-22-2006 09:24 AM

Message Edited by ccutlerbrown on 02-22-2006 09:25 AM


I am looking for the way to retrieve default value from Member Status Values. thanks.

I just want to confirm that I can not create a Custom Object and then define a lookup relationship to that same Custom Object (to create a hierarchical relationship, for example). An example might be a Custom Object called "Folder" which has a lookup relationship called "Parent Folder" of type "Folder".
  • February 13, 2006
  • Like
  • 0
On lead conversion : I want to map lead custom field to the custom field on Account, as well to the custom field on opprtunity. As of now I can map to only one custom field(either account or oppty). Is there a way to map to two objects/ fields?????????
I appreciate your help.
  • February 13, 2006
  • Like
  • 0
I'm running a php program that queries data from a local database and uses the API to create records in Salesforce.com. The code worked perfectly up until two days ago when I started recieving errors like this:

Error: XML error on line 1 col 4 byte 4 not well-formed (invalid token)
Error: org.xml.sax.SAXParseException: Invalid byte 2 of 2-byte UTF-8 sequence.
Error: curl_exec error 28 Operation timed out with 1276 out of -1 bytes received

I was wondering if anyone else was having problems like is?

Is there an API available that we can use to retrieve a user's first, last names and email address?

I heard there is a contactID associated to be a primary key in the database?

Any help is appreciated!

  • December 22, 2005
  • Like
  • 0