You need to sign in to do that
Don't have an account?
Gareth Nguyen
Constructor not Defined - Enqueue
Hi guys,
I am having an issue when trying to implement Enqueue. The error says that the constructor is not defined.
How can I fix this error?
Thank you.
I am having an issue when trying to implement Enqueue. The error says that the constructor is not defined.
Constructor not defined: [job1].<Constructor>(List<Account>)I have a trigger that enqueues a class:
trigger CreateAccount on object (before insert) { if (Trigger.isBefore && Trigger.isInsert) { System.enqueueJob(new job1(Trigger.new)); } }Here is the class that I am devloping:
public class job1 implements Queueable{ public static void job1 (List<Account> Acc) { } public void execute(QueueableContext abcs) { actions .... } }
How can I fix this error?
Thank you.
I recommend calling enqueueJob like this
Unsure if System.enqueueJob(new job1(Trigger.new)); is going to work. Maybe you should try passing a List<Account> instead
See Control Processes with Queueable Apex
Let me know if this helps, if it does, please close the query by marking it as solved. It may help others in the community. Thank You!