You need to sign in to do that
Don't have an account?

Verify SOQL
Hi...
how can I test a request SOQL in Apex?
how can I test a request SOQL in Apex?
string queryResultatString = ''; // requete: user inform into VisualPage list<sObject> queryResultat = (List<sObject>)database.query(requete); for(sObject a: queryResultat) { queryResultatString = queryResultatString + string.valueof(a); }Thank you...
https://help.salesforce.com/apex/HTViewHelpDoc?id=code_dev_console_execute_anonymous.htm&language=en
I have an Apex module that the client reports a request and then an email is sent to him with the result of that request.
But if the client report a wrong REQUEST, is possible to send an email saying that the request is incorrect?
How do I test the REQUEST to send an email saying OK or NOT OK request?
Thank you
And,if it was NOT OK send am email to the requester.
Hope this helps !!
I used TRY and CATCH:
If you look at my reply, I started with "if the request can result in bad soql' - is that the situation you are in? If not, you might need to count the number of returned items. Its impossible to tell from a couple of lines of code.
But I have the same problem
What is the problem that you are seeing?
PROBLEM: I do not get the email ...
The request informed NOT CORRECT: select name from Cont
Hiii...
I would like to send an email containing the error message if the wrong type a User request (example: select name from cont).
I tried the above code but not get the email when the request is wrong.
Help me!
String[] adressMail = new list<string> {mail};
What is mail here which you are adding to the List ??
The problem is how to send the email saying the wrong request when the User informs 'select name from Cont' or 'dddddddddddddddddddddddddddddddd'
The way I would approach is to check the debug logs and see what's there in Messaging.SendEmailResult [] envoyer,that should show me the if there is a success or failure ...
Hope this helps !!
if I submit one request that returns values, it sends email
if I report a wrong request, it does not send email ...
How do I send email error stating the request??
catch (System.QueryException e){
to
catch (Exception e){
and then try !!
WHY????????????????????????