You need to sign in to do that
Don't have an account?
Robert Davis 42
Invalid Constructor Name: System.debug
I have a Batch class that I am trying to debug and everytime I place a line of
System.Debug('Last Run Date'+LRDate);
or
System.Debug('query'+ qry);
I get the following errors:
Invalid constructor name: System.debug
Please help me with what I a missing. Never run into this problem before.
Robert
System.Debug('Last Run Date'+LRDate);
or
System.Debug('query'+ qry);
I get the following errors:
Invalid constructor name: System.debug
Please help me with what I a missing. Never run into this problem before.
Robert
You cannot add a "system.debug" directly inside a class, it should be present inside a method.
If you want to debug the query then add debug inside Batch's start method.
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
All Answers
Sorry for this issue you are facing.
May I request you please post the complete code snippet of what you have so far so that we can look into it and can help you troubleshoot the issue.
Happy to help further.
Regards,
Nagendra
Thanks for the help. Below is the start of the batch class:
I get the following PROBLEMS in the lower section of the Developer Console:
AccountABCMktg - 13 - Expecting ')' but was: 'query'
AccountABCMktg - 13 - Unexpected token ')'.
AccountABCMktg - 13 - Invalid constructor name: System.debug
Thanks again,
Robert
You cannot add a "system.debug" directly inside a class, it should be present inside a method.
If you want to debug the query then add debug inside Batch's start method.
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
Thank you, I never knew that. I feel a little foolish and a lot smarter.
It is the simple things.
Robert