Automatic Update Integer Field when send a Email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2025 09:13 AM
Hey guys!
Basically I need there to be a Business Rule so that when I send an email from a certain table, the increment field in that table counts +1, thus updating the subject of the email.
I already have the increment fields etc, I'm having difficulty writing the code.
How could I write this code, can anyone help me?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2025 09:26 AM
Can you elaborate more, like when you want to increase the record count whenever an email is sent on the record?
Please mark it helpful
Regrads
Priyatam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2025 11:59 AM
Sorry, I think I wasn't very clear in my questioning.
I need that, every time I send an email related to a certain table (most likely we would have to reference some field from sys_email, such as 'target table'), the increment field of that table is incremented, so I can update the subject of the email as I send the emails, for example, Subject: Update 1, Update 2, etc.
Currently I have an email template and the increment field in the desired table, I'm just having difficulty writing this in a BR.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2025 10:39 AM
Hello @luizmarcond Maybe I haven't understood the question completely however as per my understanding, here is what I have done:
Created a dummy table
Created a Before Business Rule
(function executeRule(current, previous /*null when async*/) {
// Add your code here
current.u_increment = current.u_increment + 1;
})(current, previous);
Created a dummy e-mail notification
So, whenever a new record is created in the dummy table form as shown below, the increment field's value increments to + 1
Before record creation:
After Record Submission/creation:
E-mail sent:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2025 12:01 PM
Thanks for trying helping me!
Sorry, I think I wasn't very clear in my questioning.
I need that, every time I send an email related to a certain table (most likely we would have to reference some field from sys_email, such as 'target table'), the increment field of that table is incremented, so I can update the subject of the email as I send the emails, for example, Subject: Update 1, Update 2, etc.
Currently I have an email template and the increment field in the desired table, I'm just having difficulty writing this in a BR.