• Leandro Fernandes 12
  • NEWBIE
  • 15 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
Is there a way to retrieve last successfully processed replay id from a pushtopic subscription?  The main issue here is that there doesn't appear to be a replay option when subscribing to a stream to say "continue where we last left off," with the closest options being "all events in the last 24 hours" and "continue from _this_ replay id"...

I'm using the streaming API to implement real-time data synchronization between SF and our backend data stores.  If the backend service that subscribes to these pushtopics could be guaranteed to always run forever with no downtime, it might be ok, but reality is things happen, and even if they don't, updated versions of the service require that it be stopped temporarily.  When it resumes, I'd really love a way to avoid having to have stored the last successful replay id to pass to SF, but am curious what that workaround might be.  If I just say "give me everything in the last 24 hours", I'll need to implement something to de-dupe already processed messages, which is also not ideal, but, things seldom are.

Using the 'jsforce' module for a nodejs command line application on this one, using oauth username/password flow.

Is there any way to add an error to an record being updated in a trigger and send an email. The trigger needs to send an email (one per batch). The email works fine if the processing generates no errors and I do not use the addError method. If I use the addError method to pass a message back to the user then the email is not sent.

 

So is there a way to send an email and use addError in the same trigger code? If not is there another mechanism that can be used to pass a message back to the user interface (standard salesforce UI).

 

Thanks

 

Dave

  • December 08, 2009
  • Like
  • 0
I know we have options for:

trigger.isBefore
trigger.isAfter
trigger.isInsert
trigger.isUpdate
trigger.isDelete
trigger.isUpsert

but is there a way to distinguish in the trigger whether it is before or after the Workflow has been evaluated, such as

trigger.isBeforeWorkflow
trigger.isAfterWorkflow

Would this be a good idea?