Email Script (To print dynamic days through Email notification)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2025 10:16 PM
Hi,
I have created a below script however when I am triggering notification it is showing days like that in format 14141415. Could you please let me know what is the specific issue because of which it is showing like this.
Name of the email script :- sn_dynamic_values_renewal_date
Below is the attached code for reference: -
Eg :- Renewal date is scheduled on 09/07/2026
and the TEST Record is created on 09/07/2025 14:03:00
Based on the given script it is showing result as 0206101012 days as
This is to inform you that the TEST is scheduled for renewal on 09/07/2026, which is 0206101012 days from today.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2025 11:05 PM
You are looping through all policies and are printing every outcome (0 2 6 10 10 12).
So you are printing the difference for every found policy. What are you exactly trying to do?
If you are triggering it for a certain record, you could add a 'current' in there, or you aggregate through it and show the minimal dates. But the script itself is doing what you are asking: loop through the policies and print the difference in days for each policy.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark