How to make all fields readonly in Catalog task only after 3 months after setting the state to Closed Complete?

Ramel
Mega Guru

Hi All,

I have a requirement to make fields read only after 3 months of after setting the state to Closed Complete. We have an existing client script that does set the fields to read only once the state is Closed Complete but they wanted to change that they still want to have the ability to modify even if the State is already Closed Complete if it is still within 3 months when the state was changed to Closed Complete.

Anyone had any idea how to do this implementation following the best practice. My idea is to create a system property similar to auto incident closure then execute some script once 3 months is reached. Can someone help how to put things together to make it work?

Regards,

 

12 REPLIES 12

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

so if the closed time is filled in some field you can do this

1) display Business rule: catalog task

-> check the difference between the closed time and now time

-> store flag in g_scratchpad if difference is more than 3

2) get the scratchpad flag in client script and make the fields readonly if flag is true

Regards
Ankur

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

@Ramel 

Thank you for marking my response as helpful.

If my response helped you please mark it correct to close the question so that it benefits future readers as well.

Regards
Ankur

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

Hi Ankur,

I will update this post when I have successfully implemented the requirement. Is it possible to create a system property to define the number of months, then call the property to client script? If that is possible do you have an idea how to set that up?

Thank you.

Hi,

yes create system property which holds months as integer value

then get that using gs.getProperty() in business rule and proceed ahead for comparison

Regards
Ankur

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