We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Field validation in list view

aahitha2
Mega Expert

Hi Team,

There is an string field "X", I need to restrict the updation of negative values from table list view.

I have "ONSUBMIT" client script which is restricting from form level and same restriction is not applying for list view.

How can I achieve this?

Thanks,

Aahitha

 

1 ACCEPTED SOLUTION

Murthy Ch
Giga Sage

Hi @aahitha 

This may help you

Write OnCell edit client script on your  'X' field

function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
    var saveAndClose = true;
    //Type appropriate comment here, and begin script below
    if (newValue <= 0) {
        alert('Not poosible');
        saveAndClose = false;
    }
    callback(saveAndClose);
}

 

Thanks

Murthy

Thanks,
Murthy

View solution in original post

6 REPLIES 6

If you want to achieve this via BR only

Then use below where no script required:

when before insert update BR

find_real_file.png

find_real_file.png

Thanks

 

 

Thanks,
Murthy

Ankur Bawiskar
Tera Patron

Hi,

can you share your before update BR script and logic?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader