You need to sign in to do that
Don't have an account?
jtjaard
myBoat is a string that holds the id.
Help with Apex SOQL query
Hi,
I was just wondering why the following code might not work? I'm working through eclipse; which isn't reporting an error, but when I check my account it hasn't been uploaded. When I remove the offending code everything compiles fine and I can see it in my force account.
Code:
[Select l.Boat__c, l.List_Price__c, l.Listing_Type__c, l.Name, l.RecordTypeId from Listing_Details__c l where l.boat__c =:myBoat AND l.RecordTypeId = 'foo'].List_Price__c);
myBoat is a string that holds the id.
Thanks for any help.
why is this valid, but if I make 'a0060000004dBi5AAE' into a variable, it is now considered invalid?
Perhaps I was unclear?
The problem isn't with the value. if I hard code a value like 'a0060000004dBi5AAE' everything is fine, but if I use a variable that contains the exact same value, the soql query in my apex code fails. I don't understand why this would be an issue though.
Hey hi,
Dont know much about it but here we are trying to match a 'string' with custom object's field which is an sobject.
wot say..??
-Abhishek Singh
Here is the solution for the problem jtjaard,
use following code-snippit before the query and everything run flawlessly.
Now change the query to and you are done!!!!
make sense???