- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 07:11 AM
Hi Team,
We have set the knowledge article validity to one year, when any user tries to change it more than one more, it should not allow him to do so. the one year date only should be only populated. The field should not be read only.
How can I do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 08:12 AM
Hi @Atchutaram
This is my weak area :(. I am not a developer.
@Jaspal Singh @Sohail Khilji any help here.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 07:16 AM
Hi @Atchutaram
So you mean, it should not be more than 1 year from Now / created date?
You can put the UI policy on same.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 07:22 AM
Hi AG,
How can we do this Ui policy based on date? The validity date should not cross one year, how can we do this. I have tried of making the field read only but our customer dont want like that. they want the date should be changed more than one year.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 07:28 AM
Hi @Atchutaram
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 08:01 AM
Hi @Dr Atul G- LNG I am writing this script on on change client script. This is working but when we save the form or submit the valid to is still changing and getting the form saved.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var validityField = 'valid_to';
var onYearValidity = new Date(new Date().setFullYear(new Date().getFullYear() + 1));
var newValidity = new Date(newValue);
if(newValidity > onYearValidity) {
// g_form.clearValue(validityField);
g_form.showErrorBox(validityField,'Valid to date must be within a year from today');
} else {
g_form.hideErrorBox(validityField);
}
}