- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2024 02:30 AM
I have a requirement that client dont want "Valid To" filed on article form. If i hide will there be any issue going forward?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2024 02:46 AM
Hi @nehasingh98 ,
Valid to filed used for retiring the article when it reaches to near data, send notification to author for retiring or extending the date.
Try to explain the behavior of this field and if still they don't want it means they dont want to retire the article anymore. then do below.
- Create UI policy to hide the filed on form.
- Create schedule job to check which all are getting expire in this month, update with 1-2 years with future date. Use below script for same.
var gd = new GlideDate();
var gr = new GlideRecord('kb_knowledge');
gr.addEncodedQuery('active=true^valid_to<=javascript:gs.endOfThisMonth()');
gr.query();
while (gr.next()) {
gd.setValue(gr.valid_to);
gd.addMonthsUTC(12);
gr.valid_to = gd.getDisplayValue();
gr.setWorkflow(false);
gr.update();
}
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2024 02:36 AM - edited ‎12-18-2024 02:37 AM
Hi @nehasingh98 ,
I dont think so, because data is still available for any business process logic running behind ( if applied, like for KB retire ) .
You can remove from KB from, and keep the field in table. You need to check the which field is gover the retire logic in your org instance.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2024 02:36 AM
Yes, you can hide if it is not mandatory, Actually valid has some logic like sending a notification to an author before reaching at valid date. If it is empty then these notifications may not be triggered. But what is the benefit of hiding it? It is a valuable field and required for KB.
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
‎12-18-2024 02:46 AM
Hi @nehasingh98 ,
Valid to filed used for retiring the article when it reaches to near data, send notification to author for retiring or extending the date.
Try to explain the behavior of this field and if still they don't want it means they dont want to retire the article anymore. then do below.
- Create UI policy to hide the filed on form.
- Create schedule job to check which all are getting expire in this month, update with 1-2 years with future date. Use below script for same.
var gd = new GlideDate();
var gr = new GlideRecord('kb_knowledge');
gr.addEncodedQuery('active=true^valid_to<=javascript:gs.endOfThisMonth()');
gr.query();
while (gr.next()) {
gd.setValue(gr.valid_to);
gd.addMonthsUTC(12);
gr.valid_to = gd.getDisplayValue();
gr.setWorkflow(false);
gr.update();
}
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------