You need to sign in to do that
Don't have an account?
textual
why does select with no rows raise an error when inside a try catch
inside a try / catch, im querying a custom setting and when theres no records to select, i see an error message rather than my catch exception executing. whats up with that? how can i pre-query to ensure a record before this error page gets rendered?
try / catch does not ensure to suppress everything. The specific type you are referring here throws QueryException. If you catch QueryException or its super class Exception only then it will get caught. Example:
If you need further assistance, please post your code.
No SOQL queries are required to retrieve custom settings data. You can use standard custom settings methods to retrieve the map of name and custom settings and check the map is not null and perform your operations.
Use the following links for more info
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_custom_settings.htm
https://help.salesforce.com/apex/HTViewHelpDoc?id=cs_accessing.htm&language=en