- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2014 08:59 PM
Hello,
I'm trying to get previous value in email notification. I can get this by using Business Rule.
For example:
current.u_previous_state_string = previous.state;
But when I try to use "previous.xx" in mail script, the code didn't work:
<mail_script>
template.print("Previous State: " + previous.state);
</mail_script>
Anyone know why and how can I use "previous.xx" in right way?
Please help, thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2014 03:19 AM
Hi,
As Bhavesh said, previous is not accessible in the email notification. If your emails are triggered by an event. You could use the parm1 or parm2 to pass the previous state values.
e.g.
to pass the previous state and assignement_group you can use
gs.eventQueue("event_name", current, previous_state+"||"+previous.assignment_group.getDisplayValue(), parm2);
you could access these parameters in your email notification
<mail_script>
template.print("<br/>State : "+current.parm1.split("||")[0]);
template.print("<br/>Assignment Group : "+current.parm1.split("||")[1]);
</mail_script>
Also, just out of curiosity, if you have a field called "u_previous_state_string" on your table, why don't you directly access that field in the email notification?
Thanks,
Mandar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2023 10:43 AM
Previous value is coming as undefined for the below
template.print("<br/>State : "+current.parm1.split("||")[0]);