You need to sign in to do that
Don't have an account?
NWhite123
Auto Create Case trigger
Hi, I am an administrator rather than a developer and i am trying to create a trigger that will automatically create a case (i.e. a case is created at 1st of every month) Can anyone help with me with the code for this or advice?
Many Thanks
Can you give more details as to what you're trying to accomplish? I suspect that workflow might be a better solution for you, but would need more detail on your use case.
Triggers fire as the result of changes to existing records in Salesforce --- i.e. if an existing Case's Priority changes from "Low" to "Critical", the Case Trigger could take some action.
However, if you're trying to create a Case automatically at the start of every month, this would probably be best done through Scheduled Apex.
Regards,
Zach
Hi,
Our accountancy team (who use Salesforce) have a case raised at the beginning of every financial year that may require work being done every month (a report or journals or anything like that) we do not want the case being open for a year as the work is done say on the 1 st of each month and it may be slightly different than the work the month befoe.
What we are looking for is for one case to be raised on the 1st april (e.g.) and then that case to trigger off creating a new case each month that appears in the accountancy queue.
Hope that makes more sense.
Thanks
Here's an example of a Scheduled Apex class which will creates a new Case assigned to the Accountancy Queue. Once you have created and saved this class in your Production org, you can schedule it to run at the beginning of every month by going to: Setup > App Setup > Develop > Apex Classes > Schedule Apex. Select "CaseCreator" as the Apex Class to run, and then schedule it to run at the desired date/time intervals.
Hi
We have tried to create a new Apex Class with the code that you sent us (which was really helpful thank you) however we are getting this error
Error: Compile Error: unexpected token: '<EOF>' at line 0 column -1
Can you help us resolve this please?
Many Thanks
Natalie
This error probably means that you have unclosed curly braces, i.e. something like the following would cause the error you are getting:
If you post your code, we can help try to spot the problem.
Error: Compile Error: Test methods must be in test classes at line 48 column 36
Any idea why?