CA Service Management

 View Only
Expand all | Collapse all

Using backfill_cnt_event to fill requested_by with customer.supervisor_contact_uuid

  • 1.  Using backfill_cnt_event to fill requested_by with customer.supervisor_contact_uuid

    Posted Jul 26, 2021 05:33 PM
    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"tenanttenantName ); 
           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.


  • 2.  RE: Using backfill_cnt_event to fill requested_by with customer.supervisor_contact_uuid

    Posted Jul 27, 2021 01:20 AM
    Hi.
    There is just a thing missing.

    The backfill_cnt_event function fullfil just the part of notifying / triggering that a contact lookup field value has been changed.

    The next thing you need to do, is to fetch / get all dependent data of this new value / referenced contact. 
    This is usually done by an Ajax request
    The Ajax response could contain the needed data like organisation and location and others.
    This data can then be used to set form element values in your current html page.

    Hope that helps
    ... Michael



    ------------------------------
    Principal Services Consultant
    HCL Enterprise Studio
    Germany
    ------------------------------