This is a discussion on Fatal error: Class 'QueryResult' within the Salesforce Coding Discussions forums, part of the Salesforce category; Hi there
i'm trying to populate some fields in a web form
-
Fatal error: Class 'QueryResult'
Hi there
i'm trying to populate some fields in a web form with salesforce data
i get this error
Fatal error: Class 'QueryResult' not found in C:\scripts\index.php on line 12
from this code:
require_once("c:/php/sforce/soapclient/SforceEnterpriseClient.php");
require_once ('c:/php/sforce/soapclient/SforceHeaderOptions.php');
require_once ('c:/php/sforce/userAuth.php');
$conn= new SforceEnterpriseClient();
$conn->createconnection("enterprise.wsdl.xml");
$mylogin=$conn->login($myusername,$mypassword);
$query="select firstname,lastname,email from contact where username__c='abcdefgh'";
$response=$conn->query($query);
$queryresult = new QueryResult($response);
foreach ($queryresult->records as $result) {
$Name= $result->fields->firstname;
print_r("
name is ");
print_r ($Name);
}
thanks for any help
tammy
-
Tammy thanks for joining the site and sorry for the delay in replying back to you. Are you sure that you are logging in alright? Usually when it cannot find class. Also i do not use the enterprise wsdl file at all, I stick with the partner wsdl. It is more flexible than the enterprise in my opinion
-
hi mike
i had copied code and that QueryResult class doesn't exist
i removed that line and you were so right, once i started using the partner file and got the case right on my field names it worked!
thanks
tammy
-
Similar Threads
-
By lithiun in forum Salesforce PHP Tutorials
Replies: 2
Last Post: 10-07-2009, 03:18 PM
-
By Baburaj in forum Salesforce PHP Tutorials
Replies: 8
Last Post: 05-23-2009, 09:10 AM
-
By eventhough in forum Salesforce Coding Discussions
Replies: 2
Last Post: 02-25-2009, 07:07 PM
-
By monloi in forum Salesforce Coding Discussions
Replies: 2
Last Post: 02-18-2009, 07:26 AM
-
By mike in forum Salesforce PHP Tutorials
Replies: 2
Last Post: 03-01-2008, 05:10 PM
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
Bookmarks