Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Date field Configuration in Service Catalog

sam352120
Kilo Guru

Dear Experts,

 

We have a requirement in which the date field(Expiry date) will take the date field value as a range from todays date to five year .Any date apart from that I will throw an error message as the date has to be in that range only.

 

Please suggest any on-change/on-load client script to achieve this for a catalog form.

 

Date Field Format:(DD/MM/YYYY).

 

Thanks in Advance,

Sambit

 

2 REPLIES 2

J Siva
Kilo Patron
Kilo Patron

Hi @sam352120 
Please go with Catalog UI policy. 
Try the below one.

JSiva_0-1761119428967.png

 

JSiva_1-1761119448990.png

function onCondition() {
    g_form.clearValue("expiry_date");
    g_form.addErrorMessage("Expiry date should be within 5 years from Today");
}

Regards,
Siva

Thanks Siva for your valuable input.