Automatically close Parent record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 08:12 PM
Hi,
We have a custom record against which there are multiple emails gets sent in batches against that Target record.
Question - when all emails are sent, I want to close the parent record. How can we do this.
Currently I tried with an after BR on sys email table when state changes to Sent but the parent record does not gets closed as I am not able to identify when all the emails will be sent and timing is causing an issue with an after update BR.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 10:43 PM
Hi, I am guessing there is some sort of script involved in triggering the batch notifications?
If yes, then I would just append code to close the parent task once the notifications were triggered.
I haven't tested but would expect there to be no need to validate notification messages being sent,
as these should process and update any related record regardless of any task state - if they do not then an exception to the task update constraints in combination with closure from the notification generation script would be the best solution.
If you are not using a script to trigger your batch notifications, then you might want to update this thread with clear details of your configuration and process so that the community can better understand your issue and assist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2023 11:38 PM
You are correct. Have built an Script include to trigger batch notifications. Only issue with the approach you mentioned is for our use cases based on the email log state parent records are updated.
Say if one of them failed, state of the parent record should get updated as Send Error.
Hence we want to validate the status of the email log before we update the state of the notification record to sent.
Can you please elaborate on the approach you mentioned above. This would help me.
Regards,
Surbhi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2023 12:00 AM
Hi, I would be extremely surprised if there was ever a send error from the instance, unless an actual issue with email address being valid and the complexities involved in trying to include a 'sent' update greatly out-way any business value that you might get from the solution, especially when the entire email process outside of the SNC instance is not guaranteed delivery anyway.
Can you clarify your business requirement\use case as I think you might be incurring unnecessary technical debt for minimal return on investment.
In my script, I would simply query my parent task once the notifications were triggered and set it to closed (or the appropriate value for closed). This way resource consumption during use and customization are minimized.