Tushar
Kilo Sage

Hi @akin9 

 

can you please try with below code -

 

var characteristicGR = new GlideRecord('sn_ind_tmt_orm_order_characteristic_value');
characteristicGR.addQuery('sn_ind_tmt_orm_order_task', current.sys_id); // Filter by the current order task
characteristicGR.addQuery('characteristic.name', 'sitename'); // Filter by the characteristic name
characteristicGR.query();

var siteNameValue = '';  // Initialize variable to hold the site name value

// Loop through all the records for the current task
while (characteristicGR.next()) {
    // Retrieve the characteristic_value (or characteristic_option_value) from the record
    var tempSiteNameValue = characteristicGR.characteristic_option_value; // Replace with the correct field name if different
    
    // If we find a valid site name, update the siteNameValue variable (you can adjust logic here if needed)
    if (tempSiteNameValue) {
        siteNameValue = tempSiteNameValue;
    }
}

// If a valid siteNameValue was found, update the u_site_name field
if (siteNameValue) {
    current.u_site_name = siteNameValue;
}

 

Thanks