How to populate a field automatically?

Hi Community,

My requirement is to auto-populate the Reporter field with the contact of the current user. Can anyone help me out with this?

Thanks in advance!!



Hi Dolly,

Put this code under onEntityInitialized function

If Reporter field is a TEXT field, use below code

var currentUser = this.Terrasoft.SysValue.CURRENT_USER_CONTACT.displayValue;
this.set("UsrReporter", currentUser);

If Reporter field is a LOOKUP field which is linked to Contact object, use below code

var currentUser = this.Terrasoft.SysValue.CURRENT_USER_CONTACT;
this.set("UsrReporter", currentUser);

Fulgen Ninofranco,

Thanks for your help

Additionally, you can set this in the object itself without code. If you open the object (where all the columns are defined), you can set the default value for a column there as well:


Ryan Farley,

The "Select from System Variables" dropdown list is empty. 

I just forgot to mention that I have created this "Returns" section in a custom package "Certification".


That's because you have text field. You should create the lookup field based on Contact object. After that you will be able to select the current user.



Show all comments