Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Changing Field label using setLabelOf() based on other field value not working

Lina5
Tera Contributor

Hi Everyone,

Issue: setLabelOf() is not changing the field label dynamically on catalog item form.

I have below requirement to change the Field Label on below condition.

On the catalog item I need to change the "Additional Notes" field to read as "LSR Remarks", and make it as mandatory. When Request type field has vale "Porting orders".

For all other request types it should remain the same as previous, optional Additional Notes.

I tried below Onchange script on catalog item (variable name --> request_type) --> Field is set to mandatory when newValue === 'Porting orders' but not Changing the label.
how can I fix this? 

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }
  var additionalNotesField = g_form.getControl('additional_notes');
 
    if (newValue === 'Porting orders') {
 
        g_form.setLabelOf('additional_notes', 'LSR remarks');
        g_form.setMandatory('additional_notes', true);
    } else {
 
        g_form.setLabelOf('additional_notes', 'Additional Notes');
        g_form.setMandatory('additional_notes', false);
    }
}
Lina5_0-1738167467264.png

 




Thanks in advance!

 

1 REPLY 1

Ajith Sasi
Tera Expert

Hi Lina,

Service Catalog wont support setLabelOf() function.

AjithSasi_0-1762142513880.png

Thanks,