• DrDavidson Merch
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Hello, our platform event recovery framework started failing recently. To replicate the issue we created a new dummy__e platform event with this simple trigger:
trigger dummy on dummy__e (after insert) {
    Integer retries = 2;
    System.debug(JSON.serializePretty(Trigger.new));
    System.debug(EventBus.TriggerContext.currentContext().retries);
    for (dummy__e dummy : Trigger.new) {
        if (dummy.Number__c == 2) {
            if (EventBus.TriggerContext.currentContext().retries < retries) {
                throw new EventBus.RetryableException('Retrying error');
            } else {
                EventBus.TriggerContext.currentContext().setResumeCheckpoint(dummy.replayId);
                break;
            }
        }
        
        EventBus.TriggerContext.currentContext().setResumeCheckpoint(dummy.replayId);
    }
}
and executed the following code:
 
List<SObject> events = new List<SObject>{
    new dummy__e(Number__c = 1),
    new dummy__e(Number__c = 2),
    new dummy__e(Number__c = 3)
};
EventBus.publish(events);

What we expected is:
 
Trigger Execution 1 => all 3 events => event 1 is processed => setResumeCheckpoint is used => event 2 fails => RetryableException is thrown
Trigger Execution 2 (retry 1) => event 2 and 3 => event 2 fails => RetryableException is thrown 
Trigger Execution 3 (retry 2) => event 2 and 3 => event 2 fails => setResumeCheckpoint is used as retries are exhausted => 3 is not processed due to break;
Trigger Execution 4 => event 3 => event is processed

The problem is that Trigger Execution 4 is not happening so we don't process Event 3. This should not happen as in Trigger Execution 3 we use setResumeCheckpoint with the replayid of Event2.

 
I'm working with custom lightning email templates for Community. Now I'm trying to merge Community fields in forgot password template. How can I add Community merge fields using HML syntax?

User-added image
Hello,
We have created an apex class to populate the pre-defined field value for "From" address whose API name is ValidatedFromAddress.
We have to change the value of From field in email action based on the value of case origin field.
We tried many options but the issue is the class is being called for some of the records and for some of the records its not being called.
We have also added our class in the Support settings but still we are not able to figure out the issue can anyone help us in this.

Thanks !