Assignment Rules allow to process templates from trigger context. This is defined by Assignment Context field.
When ‘Insert’ or ‘Update’ is chosen, such Assignment Rule can be used in After Insert/Update trigger. From code perspective, scheduleDocumentGenerationForRecords() method should be implemented.
Below is the example implementation.
trigger AccountTrigger on Account (after insert, after update){ if (Trigger.isAfter && Trigger.isInsert){ ExternalDataProviderService.scheduleDocumentGenerationForRecords(Trigger.newMap.keySet()); } } |