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.

Valid to not autopulating when creating or editing articles after updating dictionary entry

laura_p
Tera Expert

On the "Valid to" dictionary entry, we used to have it set to use dynamic default that had a custom value to have all articles created and updated two years from the current date.

 

We decided to use the Article Validity feature so that each knowledge base could be different default Valid to entry.  We removed that customization and reverted the default value to the oob code below:

 

javascript: current.kb_knowledge_base ? new global.KBCommon().getDefaultValidToDateFromCurrentDate(current.kb_knowledge_base) : '';

 

However, since unchecking dynamic default and using the oob script when creating an article, the Valid to field is blank for new articles and does not change the date with edited articles.

 

I have verified that the Article Validity on each of the knowledge base is set to the correct number of days we would like for those knowledge base. But still same behavior.

 

Is there something else that needs to be updated as well when removing a custom Valid to default?

 

Thank you.

1 ACCEPTED SOLUTION

laura_p
Tera Expert

RESOLVED. 

 

A couple of days later, I went back in and it started working. Nothing has changed since the last time it was troubleshooted. Resolved on its own as code was correct.

View solution in original post

4 REPLIES 4

Viraj Hudlikar
Tera Sage
Tera Sage

Hello @laura_p 

 

The most likely cause is browser/instance caching or an Active Dictionary Override at the Knowledge Base table level (kb_knowledge).
Clear your cache (Browser cache and ServiceNow Instance Cache using cache.do in navigator).

Verify if there's an active Dictionary Override on the kb_knowledge table for the Valid to field (valid_to) that might be overriding the OOB settings, especially if the customization was done via an override initially. If present, delete or deactivate the override.

 

 

 

Note: I tried to change in my PDI with dynamic default value and latter switch back to OOTB version and it work no other config change was needed unless it was done on your instance.

 

If my response has helped you, hit the helpful button, and if your concern is solved, do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

 

Hello @Viraj Hudlikar 

 

Cleared both browser and instance cache. Same issue.

I checked the Dictionary Override for valid_to in the kb_knoweldge table but there are no overrides set.

I found some business rules related to the valid to date for knowledge articles. These were disabled to test and did not change.

 

We tested putting in a specific date in the default field and it did populate that date when creating a new article. However with the code written above it leaves it blank. Article Validity set on knowledge base and even when not set it should populate default of 2100-01-01 but it does not.

 

Tested running the script itself and it works, just when not being called during creating new or checkout out an article.

 

We are still looking into it.

 

Thanks.

laura_p
Tera Expert

RESOLVED. 

 

A couple of days later, I went back in and it started working. Nothing has changed since the last time it was troubleshooted. Resolved on its own as code was correct.

Strange but glad it got working for you again!!