I have written logic that enqueues queueable class from trigger of one object. This works perfectly when I update records and all records gets updated successfully,but in case of partial success I can get the job id in trigger but queueable class execution is not happening.
To illustrate :
trigger accountTrigger on Account(before update) {
Map<Id, Account> tempMap = new Map<Id, Account>();
for(Account acc : trigger.new){
if(acc.Name == 'Test Account')
tempMap.put(acc.Id,acc);
}
if(tempMap.size()>0){
String jobId = System.enqueueJob(new QueuebleUtility(JSON.serialize(tempMap));
System.debug('Job Id :'+jobId);
}
}
//Queueable class
public with sharing class QueuebleUtility implements Queueable {
public String jsonString;
public QueuebleUtility(String jsonString) {
this.jsonString = jsonString;
}
public void execute(QueueableContext context) {
System.debug('jsonString : '+jsonString);
}
}
In case of all success, - I can see job id as well as queueable gets executed(log file generated) In case of partial success - I can see job id but queueable doesn't execute (log file is not generated)
Is there any behavior of Salesforce that all asynchronous jobs will be rolled back in case of partial success of DML?