How can I set the a Change Owner field to default to be the created by user when a Change is Created?

frappe
Kilo Expert

On our change request form we have a new field called Change Owner.     The field is required.     I want the Change Owner field to be set to the Created by user by default. Is there a way to do that?

1 ACCEPTED SOLUTION

Kristin,



    You can use either "javascript:gs.getUserID()" in the default value or dynamic default. You can manage your code better by using dynamic defaults



Thanks,


Abhinay




Please mark Helpful, Like, or Correct depending on the impact of the response


View solution in original post

8 REPLIES 8

Thanks for all the fast responses !



Is there a best practice here?     If I avoid the before business rule am I better off (i.e. less rules the more performant the system)?



javascript:gs.getUserDisplayName() , gs.getUserID() , or Me?  



Thanks,


Kristin


i think using existing one 'Me' or javascript:gs.getUserID() is equally fine.



Kristin,



    You can use either "javascript:gs.getUserID()" in the default value or dynamic default. You can manage your code better by using dynamic defaults



Thanks,


Abhinay




Please mark Helpful, Like, or Correct depending on the impact of the response


Mihir Mohanta
Kilo Sage

Go to the dictionary of the change owner field.


In the Default field write,


javascript:gs.getUserID()




Thanks,


Mihir