You need to sign in to do that
Don't have an account?
Becky Miller 15
Constructor Not Defined - Trigger Issue
trigger QueueTrigger on Sales_Product_Category__c (after insert, after update, after delete) {
CustomTriggerSwitch__c ct = CustomTriggerSwitch__c.getValues('salescategory');
if(ct == null || ct.Active__c || Sales_Product_Category__c.business_plan__c <> null ||
Sales_Product_Category__c.ID <> null){
List<Sales_Product_Category__c> salescategory = (Trigger.isDelete ? Trigger.old : Trigger.new);
System.enqueueJob(new QuotaProductQueueable(salescategory,Trigger.oldMap));
}
}
The error is bolded : Constructor not defined: [QuotaProductQueueable].<Constructor>(List<Sales_Product_Category__c>, Map<Id,Sales_Product_Category__c>)
What am I missing?
CustomTriggerSwitch__c ct = CustomTriggerSwitch__c.getValues('salescategory');
if(ct == null || ct.Active__c || Sales_Product_Category__c.business_plan__c <> null ||
Sales_Product_Category__c.ID <> null){
List<Sales_Product_Category__c> salescategory = (Trigger.isDelete ? Trigger.old : Trigger.new);
System.enqueueJob(new QuotaProductQueueable(salescategory,Trigger.oldMap));
}
}
The error is bolded : Constructor not defined: [QuotaProductQueueable].<Constructor>(List<Sales_Product_Category__c>, Map<Id,Sales_Product_Category__c>)
What am I missing?
Best Answer chosen by Becky Miller 15
Jason Hardy
The issue is not with your trigger per sey, it's due to the QuotaProductQueueable class. Basically, you're attempting to pass in a list and a map. Salesforce is telling you that you do not have a constcutor setup for those particular types. Meaning it should have something like this defined in the QuotaProductQueueable class:
By defaul this is the only constcutor defined (even if it's not present in your code, SFDC does it automatically):
If you don't want to modify the QuotaProductQueueable class, then all you need to do is create a variable and queue it up