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  

How to disable previous dates in calendar field in service catalog variable

srinivas snow25
Kilo Contributor

How to disable previous dates in calendar field in service catalog variable

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

not possible.

you will have to run UI policy or client script to run the validation and inform the user about this

Regards
Ankur

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

srinivas snow25
Kilo Contributor

Please could you provide script

@srinivas snow2295 

Something like this

Start Date [Before] Today

Script as below in Execute if true section

function onCondition() {

    alert('Should not be select the Past Date');
    g_form.clearValue('start_date');

    g_form.setMandatory('start_date', true); // if it is mandatory

}

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

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