You need to sign in to do that
Don't have an account?
Austin Gutz
Create Tasks with Apex
Our accounting controller would like to assign tasks to different users for any account that's past due.
Basically, every Monday I need tasks auto-generated for any account where past_due_amount__c > $0. The task would be auto assigned to the user in the collections_owner__c field found on the account with a due date of the end of the week.
If Apex, can someone help me with that?
Anyone have a better idea?
Here is what I have so far.
Basically, every Monday I need tasks auto-generated for any account where past_due_amount__c > $0. The task would be auto assigned to the user in the collections_owner__c field found on the account with a due date of the end of the week.
If Apex, can someone help me with that?
Anyone have a better idea?
Here is what I have so far.
global class WeeklyAccountingTasks implements schedule{ global void execute(schedulableContext ctx){ List<account> Accts = [SELECT Id, Name, Collection_Ownership__c, Past_Due_Amount__c FROM Account WHERE Past_Due_Amount__c > 0]; // Create a task for each account in the list } }
I'm getting the following error:
Error: Compile Error: Invalid loop variable type expected Account was Case at line 9 column 1