• AAKAlan
  • NEWBIE
  • 0 Points
  • Member since 2008

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

Need help with PHP toolkit v. 13. Been using it successfully since first released, until now.

 

Client entered data into data-entry web page in CHINESE!

When I do add a record to the Lead object using this data, I'm getting an error something like:

 

Entity "aring" referenced but not declared.

 

I know that å represents the Scandinavian "A" with a ring above it, but have no idea how it's getting that from the Chinese characters, or worse, how to fix it.

 

An older application using an earlier WSDL seems to be working fine. No difference in Xhtml headers between the two.

Any ideas how to deal with this?

 

Any and all help would be greatly appreciated. We cannot deploy the current application. The client has offices in China.

 

Thank you

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 problem with a German "u-umlaut" using PHP SOAP, the PHP Toolkit and IE 7.

 

I'm retrieving data from a Salesforce object (Lead).

 

It includes a German name that has umlauts (u with 2 dots) in the company name.

 

It is showing in the browser as two boxes. If I change the HTML charset, I get even worse : a Spanish n-cedilla followed by "1/4".

 

In no case have I been able to see or save the u-umlaut

 

I have changed charset in the generated HTML, even in the WSDL and yet the umlauts are escaping me completely.

 

What am I doing wrong? This has to be some kind of charset problem.

 

 

Thanks in advance,

 

Alan

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.

Question about a salesforce.com button.

I have a highly customized activity.

It has a Save button (standard button)

I need to put in some Javascript validation/update code before the save of the current record executes.

 

How do I do this?

 

Is there some way to add the code to a Save button without destroying its save functionality?

 

Or should I create a custom Save button and hide the built-in Save Button. If this is the case, what syntax do I use to cause the new, unsaved page to save and update() the object?

 

Thank you. This is my first Salesforce button. I've done a lot of remote SOAP stuff with Salesforce, but this is my first time wrestling with the UI.

I need to upsert() records into a custom SalesForce object from my customer's survey form.
 
I had hoped to use the AJAX toolkit to access SalesForce through JavaScript from my web page.
 
First: is this feasible? Every sample I've read so far uses the tookits from within the SalesForce environment, not from a remote web page.
 
I've written code that seems like it should work, but the sforce.connection object is never created. Of course, all my samples have a local reference to the toolkit file (\soap\version\connection.js), which will not work from my page, since it's not on the same domain as SalesForce.
 
Can I download the AJAX toolkit and run it locally? Can I load the AJAX toolkit remotely using  a fully-qualified URL (if I knew what that URL was)?
 
Or is it simply impossible to update a SalesForce object from a remote web page that's not on the SalesForce.com domain?
 
Color me "lost in space":smileyhappy:
 
Thanks for any help
 
Alan A. Katz
 
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

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