You need to sign in to do that
Don't have an account?
gokubi
error with query result in php toolkit
I'm working in the php toolkit for the first time, but I am proficient in the ajax toolkit.
I have successfully upserted some records to sf.com, but I'm having problems getting some query results back. This code is erroring out on me:
Code:
PHP Notice: Trying to get property of non-object in C:\...\SforcePartnerClient.php on line 47
Any thoughts on why this isn't working?
Thanks,
Steve
I have successfully upserted some records to sf.com, but I'm having problems getting some query results back. This code is erroring out on me:
Code:
$Account_query = "Select Id, Name from Account where Dot_Project_Number__c = '".$company_id."'"; $Account_query_Result = $mySforceConnection->query($Account_query); foreach ($Account_query_Result as $ThisAccount) { $sObject = new SObject($ThisAccount); //error on this line $Account_Id = $sObject->Id; }The error is:
PHP Notice: Trying to get property of non-object in C:\...\SforcePartnerClient.php on line 47
Any thoughts on why this isn't working?
Thanks,
Steve
var_dump($Account_query_Result);
to see what you actually get back. And start with a simple query as Adam suggested.
Steve
This is the logic to use:
Another user has informed me that there is an error in instructions.html. I will update this on Monday and refresh the zip.
Message Edited by Tran Man on 03-12-2006 08:25 PM
Just a thought.
Park
Steve
Great idea. This will be in the next php toolkit refresh which I have submitted. I'll let everyone know when it gets pushed out.
Thanks
Thanks.
Message Edited by Tran Man on 03-14-2006 10:04 AM
The extra changes I did in SforceBaseClient.php were using is_null() instead of ==NULL (a safer comparison), and using the logical 'and' operator instead of the bitwise operator & (I suspect you may have intended to use && which does a low-precedence logical and). I also did some cleanup in the comment formatting and removed all trailing whitespace. It might be just me, but I always use ONLY tabs for indenting - I can understand using all spaces, but mixing them is definitely out ;^)
While I welcome the addition of _handleRecords(), it might have been worth sticking a warning on the docs as it may break code that's expecting the old behaviour. I think it should also be marked protected as nothing outside the class should have any use for it.
In SforcePartnerClient.php I changed constructors to use __construct, and switched convertFields to use str_replace instead of the much slower ereg_replace.
The unit tests run ok, apart from a bunch of notices about using stdClass undeclared properties, and the report generation fails saying "Could not find file ..\..\infra\php/phpunit2-frames.xsl"
How would you like patches submitted? To sf.net patches? Or should I email stuff to you?