How to highlight when mandatory field and tab is empty?

swe
Tera Contributor

I want to achieve same functionality for vendor field and related tab. if mandatory field (vendor) is empty than related record tab should open and field should populate in red.please look in to image.

4 REPLIES 4

Sagar Pagar
Tera Patron

Hi,

You can try with

   g_form.getControl('fieldName').focus();

 

Refer this support docs for your solution.

How to use .focus() on a Field

 

Thanks!

Sagar Pagar

The world works with ServiceNow

swe
Tera Contributor

do I need to use client script or anything else?

You can use this in UI Policy script or Client scripts.

The world works with ServiceNow

swe
Tera Contributor

It would be great if anyone share detailed steps.