1. In the Profile or Permission Set, Disable “Multi-Factor Authentication for API Logins” and “Multi-Factor Authentication for User Interface Logins”.

2. In the Profile or Permission Set, set “Session Security Level Required at Login” to None.

--

--

The Transaction Finalizers feature enables you to attach actions, using the System.Finalizer interface, to asynchronous Apex jobs that use the Queueable framework. A specific use case is to design recovery actions when a Queueable job fails.

Sample Use Cases:
1. Retry in FinalizerContext if the queueable job fails
2. Add error log record in FinalizerContext to report on failures

Sample Class:

public class SampleClass implements Finalizer, Queueable {public void execute( QueueableContext ctx ) {
}
public void execute( FinalizerContext ctx ) {

String parentJobId = '' + ctx.getAsyncApexJobId();
if ( ctx.getResult() == ParentJobResult.SUCCESS) {

System.debug('Parent queueable job [' + parentJobId + '] completed successfully.');

} else {

System.debug( 'Parent queueable job [' + parentJobId + '] failed due to unhandled exception: ' + ctx.getException().getMessage() );

}

}

}

--

--