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
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);
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