KanteS
Tera Guru

Hi @Stergios Stergi 

Based on my understanding, In client scripts, you have two options to check if a field exists before validating it:

  1. g_form.hasField(field name)– This is the cleanest and most readable method. It returns true if the field exists on the form, and false if it does not.

  2.  g_form.getControl(fieldName)– This method returns the HTML element for the specified field. If the field does not exist on the form, it returns null.

Using either method allows your script to skip validation when the field is not present, so older incidents can be reassigned without issues, while new incidents still enforce the required selection.

 

Thank you