How to add an "email sent" counter to the CS form?

Jesus Nava
Tera Guru

Hello everyone, I need your help with the following,

I need to add an email counter for emails sent within the same CS number, 

JesusNava_0-1749758119880.png

here is the field I added, I used a BR for this:

JesusNava_1-1749758325992.pngJesusNava_2-1749758355524.png

This is working if I add comments or worknotes, but the problem is that emails sent are added to the journal but the counter does not count them because they are from a different table, can you guide me on how this can be achieved?

Thank you!

1 ACCEPTED SOLUTION

Hello and sorry for the time taken, I ended up creating an inbound action that adds up each email received to the case so I created a new field, and then the inbound, thank you!

JesusNava_0-1752013326352.png

here's the piece of code that I used, hope someone else finds it useful.

View solution in original post

3 REPLIES 3

YaswanthKurre
Tera Guru

HI @Jesus Nava ,

 

You have to check sys_email for outbound emails.

 

 

  • Trigger:
    BR runs after insert/update on the sys_email table to increment an email counter on related Customer Service (CS) records only when emails are outbound and sent or ready to send.

  • Condition Logic:
    Ensures execution only for emails that change to 'sent' or 'send-ready', and are linked to relevant CS tables like sn_customerservice_case( whatever your table is..)

  • Functionality:
    Uses GlideRecord to locate the parent CS record, checks if the custom email counter field (u_email_counter) exists, increments its value, and updates the record without triggering workflows or system field changes.

  • Performance Consideration:
    Uses an After Business Rule for reliable data access and low impact. For very high email volumes, an Async Business Rule could be used to reduce any processing delay.

Mark this as helpful and correct  if this answers your question.

 

Thanks,

Yaswanth

 

Hello @YaswanthKurre I will do what you are suggesting and get back to you with my results,

 

Regards

Hello and sorry for the time taken, I ended up creating an inbound action that adds up each email received to the case so I created a new field, and then the inbound, thank you!

JesusNava_0-1752013326352.png

here's the piece of code that I used, hope someone else finds it useful.