• AAKAlan
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 8
    Replies

I've gotten pretty proficient at escaping characters as needed, but this time the problem is in a query itself.

 

Here's the basic code. It's using the SalesForce.com PHP toolkit:

 

  $userid = $_POST["userid"];

 

  $mySforceConnection = new SforcePartnerClient();
  $mySoapClient = $mySforceConnection->createConnection('partner.wsdl.xml');
  $mylogin = $mySforceConnection->login($username, $password);

 

  $userid = htmlentities($userid);

 

  $query = "select id from contact where User_ID__c ='$userid'";


  $response = $mySforceConnection->query($query);
  $queryResult = new QueryResult($response);

 

It's the query, that's breaking because there's a backslash ("\") in the userid ("alan\katz").

 

Unfortunately, I can't control the userids, so I'm stuck with it. 

 

Here's the error:

ERROR at Row:1:Column:48 line 1:48 mismatched character '\' expecting '''
I tried using htmlentities, but that doesn't seem to fix it.
Any ideas? Please, I'm a bit desperate on this one!

Hi,

 

I'm having a wierd query problem with the lead object.

 

Here's my SQL query:

 

$query = "select FirstName, LastName, Address, Company, Phone, Email from lead where Id = '$leadid'";

 

Unfortunately, running this query via the API, I keep getting the following error message:

 

INVALID_FIELD: select FirstName, LastName, Address, Company, Phone, Email from ^ ERROR at Row:1:Column:29 No such column 'Address' on entity 'Lead'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

 

I have checked the lead object over and over again using Setup/Customize/Fields and "Address" appears to be a perfectly valid fieldname. However, when I remove "Address" from the query, it works perfectly.

 

Any idea why the query is rejecting the Address field?

 

Thanks in advance....

 

P.S. Using the Partner WSDL.

Please be gentle, I'm new to SalesForce
 
I've written a web application. All I need to do is send the data gathered by the web page back to SalesForce.com using JavaScript, hence the Ajax toolkit.
 
But I can't seem to get started. I've read all the manuals I can find and looked at all the sample code.
 
However, I can't even get the Ajax Toolkit loaded.
 
Every example uses something like the following:
 
<script src="/soap/ajax/11.1/connection.js" type="text/javascript"></<script src="/soap/ajax/11.1/connection.js" type="text/javascript">
 
Of course, this script uses a relative address to some location on SalesForce.com.
 
How do I access the toolkit from a browser? Is there a fully-qualified URL I can use for the .js file?
I can't find that information anywhere.
 
Also, which revision should I be using?
 
Thank you. I'm stuck :-)
 
Alan A. Katz
New SalesForce developer - barely treading water despite 20+ years programming!:smileyhappy:
 
I need to map data from JavaScript to an existing SalesForce object in a remote application. My original data is from a Flash application and I need to update a SalesForce object.
 
Question 1: What type of data does a Picklist field type take? The text of the actual selection or the relative number of the selection on the options list?
 
Question 2: What type of data does a Checkbox field type take? "True/False" as text, JavaScript True/False boolean or typical SQL 1/0 as integer?
 
I can't seem to find this information in any of the guides.
 
Thank you for any help.
 
A. A. Katz (Alan)
 
Hi, everyone, I'm new to force.com programming, though I'm reasonably expert in 7 other programming languages and have been doing stuff like this for more than 20 years. In fact, I've written books for other programmers. But when it comes to salesforce.com/Apex/Javascript Toolkit, I feel like a rank beginner!
 
I am having trouble finding a resource for basic programming concepts, though I've downloaded and read most of what appear to be the relevant .pdfs and looked at tons of sample code.
 
Perhaps you might be kind enough to point me in the right direction?
 
Question 1: I note that many sample formulas use "Account.fieldname_c" in some calculations. as opposed to "Account.fieldname". What does the "_c" signify?  I'm writing for custom buttons right now.
 
Question 2: I note in some code sources, Objecttype.Account is used, but button examples seem to use sObject.Account. Does sObject stand for "standard object"? When is one or the other used?
 
Question 3: Please can you point me to some comprehensive language documentation that actually explains the underlying concepts? Most of the documentation so far brings up "merge fields" and then gives a list of how to reference them from different parts of Salesforce.com without ever defining what a "merge field" is, and how one is created or accessed. I admit to being absolutely baffled as to when to use "!" and when not to use it, though I see hundreds of examples. What is the rule?
 
Any comprehensive programming documentation would be a great help at this point.
 
Thank you all. I hope to soon join your ranks as an accomplished force.com developer!
 
Alan A. Katz