Does anyone know if it's possible to leverage the backfill_cnt_event function in the detail_cr.htmpl page so the requested_by field fills based on the customer's supervisor? We have our system currently using the customer.supervisor_contact_uuid if the requested_by is null, but this results in missing tickets when searching by the requester. If possible we'd also like to fill the organization and location based on the customer values, but I assume once I know the code for the requested_by, I can get the other two working.
We tried having the customer aspect of that function mimic what the requested_by one does, but it never loads so I assume I'm calling customer.supervisor_contact_uuid incorrectly.
if(base_name == "customer") {
var f = document.main_form;
if ( typeof f == "object" &&
typeof f.customer_combo_name == "object" &&
typeof f.requested_by_combo_name == "object" &&
( f.requested_by_combo_name.value == req_value ||
f.requested_by_combo_name.value == "" ) ) {
req_value = f.customer_supervisor_contact_uuid_combo_name.value;
f.requested_by_combo_name.value = req_value;
f.requested_by_fname.value = f.customer_supervisor_customer_uuid_fname.value;
f.requested_by_mname.value = f.customer_supervisor_customer_uuid_mname.value;
f.requested_by_lname.value = f.customer_supervisor_customer_uuid_lname.value;
f.elements["SET.requested_by"].value = f.elements["SET.customer_supervisor_contact_uuid"].value;
f.elements["KEY.requested_by"].value = f.elements["KEY.customer_supervisor_contact_uuid"].value;
cat_related_cnt = 1;
if ( f.elements["SET.requested_by"].value != "" ) {
setOrgId = 1;
alert_banner(f.elements["SET.requested_by"].value);
}
if ( typeof tenant == "string" && tenant.length > 0 )
detailSetTenant( "requested_by", tenant, tenantName );
else if ( typeof _dtl.tenantImplyingFields == "object" && !f.elements["SET.customer_supervisor_contact_uuid"].value) {
detailSetTenant( "customer_supervisor_contact_uuid", "", "" );
detailSetTenant( "requested_by", "", "" );
}
}else if(typeof f == "object" &&
typeof f.customer_combo_name == "object" &&
f.customer_combo_name.value != ""){
alert_banner(f.elements["SET.requested_by"].value);
}
}
Any advice would be appreciated.