I have set 'Valid To' date on Knowledge article to 1 year after publish and it is auto populating when I create a new Knowledge article.But if I reject the retire/republish the article Valid To field is setting to 01-01-2100.

jyotsna1
Giga Contributor

I have set 'Valid To' date on Knowledge article to 1 year after publish and it is auto populating when I create a new Knowledge article.But if I reject the retire/republish the article Valid To field is setting to 01-01-2100.

I  can see there is a Article Validity field on Knowledge base form, is this field causing the issue? If yes how to set a value on this field.

Can someone help how to fix this?

Immediate help would be highly appreciated.

Thanks

1 ACCEPTED SOLUTION

DirkRedeker
Mega Sage

Hi

Digging into ServiceNow is fun! Read this one for even more details:

One more information, that may come in handy in this scenario.

The screenshot below shows the Script Include "KBCommonSNC" with the function "getDefaultValidToDateFromDate()". This function return "2100-01-01" (HARDCODED) (1) when the field "article_validity" on the KB Base Record is empty (2), and returns the date added with the number of days in that field (3) if it is not empty.

find_real_file.png

Let me know if that answers your question and mark my answer as correct/helpful, please.

Thanks and enjoy

BR

Dirk

 

View solution in original post

7 REPLIES 7

DirkRedeker
Mega Sage

Hi

The following Client Script checks for the "Default" Validity date:

DirkRedeker
Mega Sage

Hi

Digging into ServiceNow is fun! Read this one for even more details:

One more information, that may come in handy in this scenario.

The screenshot below shows the Script Include "KBCommonSNC" with the function "getDefaultValidToDateFromDate()". This function return "2100-01-01" (HARDCODED) (1) when the field "article_validity" on the KB Base Record is empty (2), and returns the date added with the number of days in that field (3) if it is not empty.

find_real_file.png

Let me know if that answers your question and mark my answer as correct/helpful, please.

Thanks and enjoy

BR

Dirk

 

How do I navigate myself to this script?