When the value of a particular field changes , work notes should populate the change on Incident table

sonita
Giga Guru

I have a field on the incident table . the type is string , When the value of a the field changes or a value is added ,   work notes should populate the change on Incident table.

I have created a business rule for that on insert and update. but i think there is a problem that it does not work:

this is the condition:

find_real_file.png

current.work_notes = u_change_tracking;

Any help would be appreciated.

1 ACCEPTED SOLUTION

Ok so may be you can write a script like this:



current.work_notes = 'The value of Change tracking # field changed from ' + previous.u_change_tracking + ' to ' + current.u_change_tracking ;


current.update();



Let me know if this helps.



Thanks and Regards,


Aswin Siddalingam


View solution in original post

9 REPLIES 9

Hi Soni



Try to log something in your script and see whether it is executing or not so that you can confirm that it is passing the WHEN condition or not



try to create onChange client script and see if it works


Creating a client script for this might back fire when the value of Change Tracking # changes and when the analyst at the same time wants to enter work notes also.



Thanks and Regards,


Aswin Siddalingam


Thanks, This helped me

Inactive_Us1014
Tera Contributor

I think you just need a 'current.' in front of u_change_tracking.



So


current.work_notes = current.u_change_tracking;



Adding an edit:


It is likely that at some a point a user will make a change to the # and have written their own work notes, in which case on update their notes will be lost and replaced thie the current #. It would be better to write



var wNotes=   current.work_notes;


wNotes = wNotes + '\nNew change tracking #: ' + current.u_change_tracking;


current.work_notes = wNotes;


Deepa Srivastav
Kilo Sage

this current.work_notes = u_change_tracking; is wrong... you cant use   u_change_tracking directly.


Also you can write onchange client script on that change_tracking field.


--


Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.