Business Rule - Updated by Field

mateusz3
Mega Contributor

Hi Guys.

I have a small problem with the Updated by field.

My company has implemented a single sign on, and we had to update the user id field to a unique reference number for our company.

I think the best way would be to implement a business rule for when the updated by field meets the patern to, but I am unable to find the correct field.

Ideally I would like that field to populate the name of the user that is updating the incident form.

Anyone has an idea how the script should look ? (I am quite neewbe in SN...no it experiance)

Thanks in advance

Matt

7 REPLIES 7

Hi matt,



I kind of depends. If you only will use it on incidents, I would put it there. But if youre going to use it in other types that extends from task, i would put it on task table instead. Then you dont have to build it for each type.



Remember thou that much comes from task, but not everything



Let me know if my explaination wasnt good enough



//Göran


Sorry to resurrect an old thread but i'm just wondering if you can advise on the script that would be required to set the updated_by field based on the content of the sys_updated_by field?


In case anyone else is wondering, the following seems to work in a before insert and update business rule



var gr = new GlideRecord('sys_user');  


if (gr.get('user_name', current.sys_updated_by)){  


  current.u_updated_by = gr.sys_id;  


}