You need to sign in to do that
Don't have an account?
Riothamus
Embedded variables in Query
This method gets an Account object using an object_id, but it is throwing an exception. I know the object_id exists, because I get it from an Account object stored in the database (the code is used in an @future method, so I can't use the object).
Why would this be failing? Is it syntax in the SELECT statement?
protected override object getObjectById(Id object_id) {
List<Account> account_scope = [SELECT Id FROM Account Where Id = :object_id];
return account_scope.size() == 0 ? null : account_scope.get(0);
}
In the developer console you can also produce heap dumps at regular points. See:
https://na6.salesforce.com/help/doc/en/code_dev_console_view_code_editor.htm#code_dev_console_view_code_enable_heapdump_capture
All Answers
As you are using static apex, the syntax is validated at compile time.
When you say fail, what do you see? Is it a return value of null?
Hi Bob,
Sorry to be late getting back to you. I was getting an exception, but I think that I was tracing it to the wrong place in the code. This is now working.
I'm relatively new at Salesforce and finding the debugging tools a little lacking. The primary method I've used is to log messages, run it in the Developer Console, and check the log file for results. Is there other methods I could be using?
In the developer console you can also produce heap dumps at regular points. See:
https://na6.salesforce.com/help/doc/en/code_dev_console_view_code_editor.htm#code_dev_console_view_code_enable_heapdump_capture