How to make a list of new changed value field.

Jeni Sebastian
Mega Contributor

Hi all! I really need your help ...

I need to make a list of the newly changed HR and need to send it every month.

What I did was I created a new field "Old Value HR" to fill  the previous value of the HR. 

find_real_file.png

 

 I tried to create a report for this so that it will refrain to send notif every month but unfortunately  I cannot get the records that only update the "HR Partner" field , I cant filter it by just having filter conditions in a table.

 

So  I also tried  to make a script in BR and it seems like its not working at all because it doesn't pop up the info message.

 

BR: (When to run : Before Update)

(function executeRule(current, previous /*null when async*/ ) {
current.old_hr_partner_eid = previous.u_hr_partner_eid; //to get the previous value of HR
 
var changed_fields = getChangedFieldNames(current);
 
if (change_fields == 'u_hr_partner_eid'){
gs.addInfoMessage("hr partner has been updated");
//gs.eventQueue()
 
}
return result;
 
    
})(current, previous);
 
3 REPLIES 3

Aman Kumar S
Kilo Patron

Can you show complete script here?

if (change_fields == 'u_hr_partner_eid'){// shouldn't it be changed_fields 

Best Regards
Aman Kumar

Hi @Aman Kumar 

Here's the  business rules for the HR Partner Field ( The table on this BR is the sys_user /when to run: After Update / Filter conditions: HR People Advisor Ref changes)

Line 10 is the code that i need to remove since it is sending notification everytime it changes the value of HR partner field and also need to remove it because i need to send the whole list of the New HR Partner every month

find_real_file.png

 

and here's the business rule that I created for the "Old HR Partner" field and the table for this one is a custom table (when to  run: before update):

find_real_file.png

What is this function?

getChangedFieldNames

Best Regards
Aman Kumar