How to populate user reference field with created by user of the record

JohnDF
Mega Sage

Hi everyone,

 

how can I populate a user reference field with created by user of the record?

 

Thanks for help.

1 ACCEPTED SOLUTION

Abhit
Tera Guru

@JohnDF  - Create the dictionary overide on the cmdb.owned_by as the field is cloned down from there. see the below screenshot.

Abhit_0-1667039166881.png

 


Solution2: You can write an onBefore insert BR on the table, condition: class: service  and just set the field value

current.field_name = gs.getUserID();


As in your case you are letting users to change the value anytime.

 

 

Abhit Kumar

 

View solution in original post

6 REPLIES 6

Abhit
Tera Guru

@JohnDF  - Create the dictionary overide on the cmdb.owned_by as the field is cloned down from there. see the below screenshot.

Abhit_0-1667039166881.png

 


Solution2: You can write an onBefore insert BR on the table, condition: class: service  and just set the field value

current.field_name = gs.getUserID();


As in your case you are letting users to change the value anytime.

 

 

Abhit Kumar

 

mr18
Tera Guru
Tera Guru

Hi @JohnDF,

Please follow the following steps:

1. Open dictionary table and use following filter:

table = cmdb AND column name = owned_by

mr18_0-1667052172891.png

 

2. Set the default value as javascript:gs.getUserID()

mr18_1-1667052250515.png