Hello everyone
How can I automatically obtain the user's name in a client field?
Categories:
Hello everyone
How can I automatically obtain the user's name in a client field?
Several options
// populate lookup, assumes the user is logged in
// and the script is in a Web Template or Web Page Content where the Liquid user object is available
// I have freehand typed most of this so there could be some syntax issues etc
$(document).ready(function() {
var contactId = "{{ user.id }}";
var contactName = "{{ user.fullname }}";
$(“#yourfieldlogicalschemaname_name”).attr(“value”,contactName);
$(“#yourfieldlogicalschemaname”).attr(“value”,contactId);
// account instead of contact if populating with an account record
$(“#yourfieldlogicalschemaname_entityname”).attr(“value”,”contact”);
});