Record history of fields modified in each Edit action

Posted by kmasani on 07-May-2014 07:01

Hello All,


We are developing an internal application for our team and one of the key requirements is to track each and every change made to the record fields. Rollbase inbuilt 'Auditing' feature doesn't support Textarea fields and we have quite a few fields of this type. So we are trying to do a custom solution for this use case.


I have following code on 'OnSubmit' event of 'Edit' page on my application :

--

function my_callback (objName, objId, values) {

  var server_headline = values['name'];
  var server_status   = values['status'];

  var browser_headline = $("#name").val();
  var browser_status     = $("#status").val();

  var edit_changes = '';

  if ( browser_headline != server_headline ) {
 
    edit_change = edit_change + " " + "Old Headline : " + server_headline + "," + "New Headline : " + browser_headline;
  }
 
  if ( browser_status != server_status ) {
   
    edit_change = edit_change + " " + "Old status : " + server_status + "," + "New status : " + browser_status;
  }
 
  $('#history_log').val(edit_change);
}  

rbf_getFields("ticket3", "{!id}", "name,status", my_callback);

--

But for some reason I don't see the control going to the callback function. Can you please advise what might be the problem here ? Or if there is a better way to handle this use case ?


Thanks, Kiran

All Replies

Posted by Laurent on 07-May-2014 09:52

First of all, do you see any error in the JavaScript console? If you replace my_callback with function(objName, objId, values) { console.log('Called'); } do you see anything in the console?

This thread is closed