getReference() gets the record used in another reference field. For example you have the requested_for (reference to the sys_user table) and with getReference, you will retrieve the User record and save this as a gliderecord into a variable.
Why we use callback function with getReference?
callback function allow you to use asynchronous processing with your getReference call.
Example: FetchCompany&phoneNo
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return; }
var requester_user = g_form.getReference('requested_for', callback);
function callback(requester_user) {
g_form.setValue('email_id',requester_user.email);
g_form.setValue('manager', requester_user.manager);
}
}
Comments
Post a Comment