Old value/New value of every field on the form

Dawid2
Giga Guru

Hello,

Is there a way to list previous value and new value into the script of Business rule? I'm currently utilizing following script:

if (current.manager.changes()){

              var manOne = previous.manager.getDisplayValue();

              var manTwo = current.manager.getDisplayValue();

              listOne = 'Manager has changed from ' + manOne + ' to ' +manTwo;

However, since we have so many fields on the form, I would like to use something simpler and not to list every field separately. I would also like to maintain the form of "[Field Name] has change from [previous value] to [new value]". Can this be achieved?

Thanks.

5 REPLIES 5

Steven1
Tera Expert

The OOB activity formatter provides an easy way to track items not saved with a field in the record



Please see : http://wiki.servicenow.com/index.php?title=Activity_Formatter#gsc.tab=0



Anurag Tripathi
Mega Patron
Mega Patron

This is what you need, this will certainly help you get the answer you are looking for



Checking for Modified or Changed Fields in Script - ServiceNow Guru


-Anurag

Chuck Tomasi
Tera Patron

You can always add the "Audit History" related list.



Form menu> Configure> Related Lists. Add "Audit History".



find_real_file.png


Thanks guys.



I need the values to use in Business Rule as event.parm1 which can be transferred later into the email notification.



Like, "Hey, this form has been updated, here are the fields that were updated with previous and new values".