Question

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!!

Like 0

Like

5 comments

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

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".

Dolly,

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.

Regards,

Dean

Show all comments