<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Restrict knowledge article validity in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833802#M1085884</link>
    <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/174084"&gt;@Dr Atul - LNG&lt;/a&gt;&amp;nbsp;thanks &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/387748"&gt;@Atchutaram&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are 2 dates here one is article created date and another one is today's date so which of this 2 dates do you want to limit it to 1year ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's today's date then you can simply do it with UI policy using relative filter. If it's created (or published date) you have to use Client script and check if the date selected falls within the 365days since publish or created.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Feb 2024 16:47:19 GMT</pubDate>
    <dc:creator>Community Alums</dc:creator>
    <dc:date>2024-02-20T16:47:19Z</dc:date>
    <item>
      <title>Restrict knowledge article validity</title>
      <link>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833635#M1085828</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 15:11:42 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833635#M1085828</guid>
      <dc:creator>Atchutaram</dc:creator>
      <dc:date>2024-02-20T15:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict knowledge article validity</title>
      <link>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833642#M1085832</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/387748"&gt;@Atchutaram&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you mean, it should not be more than 1 year from Now / created date?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can put the UI policy on same.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 15:16:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833642#M1085832</guid>
      <dc:creator>Dr Atul - LNG</dc:creator>
      <dc:date>2024-02-20T15:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict knowledge article validity</title>
      <link>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833659#M1085840</link>
      <description>&lt;P&gt;Hi AG,&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;How can we do this Ui policy based on date?&amp;nbsp; 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.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 15:22:03 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833659#M1085840</guid>
      <dc:creator>Atchutaram</dc:creator>
      <dc:date>2024-02-20T15:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict knowledge article validity</title>
      <link>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833673#M1085842</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/387748"&gt;@Atchutaram&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.servicenow.com/community/developer-articles/no-code-date-validations-through-catalog-ui-policies/ta-p/2297600" target="_blank"&gt;https://www.servicenow.com/community/developer-articles/no-code-date-validations-through-catalog-ui-policies/ta-p/2297600&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.servicenow.com/community/itsm-forum/how-to-restrict-date-field-range-upto-12-months-from-current/m-p/903786" target="_blank"&gt;https://www.servicenow.com/community/itsm-forum/how-to-restrict-date-field-range-upto-12-months-from-current/m-p/903786&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.servicenow.com/community/itsm-forum/prevent-user-from-entering-an-end-date-that-is-30-days-greater/td-p/505543" target="_blank"&gt;https://www.servicenow.com/community/itsm-forum/prevent-user-from-entering-an-end-date-that-is-30-days-greater/td-p/505543&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 15:28:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833673#M1085842</guid>
      <dc:creator>Dr Atul - LNG</dc:creator>
      <dc:date>2024-02-20T15:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict knowledge article validity</title>
      <link>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833719#M1085858</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/174084"&gt;@Dr Atul - LNG&lt;/a&gt;&amp;nbsp; 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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;function onChange(control, oldValue, newValue, isLoading, isTemplate) {&lt;BR /&gt;if (isLoading || newValue === '') {&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;var validityField = 'valid_to';&lt;BR /&gt;&amp;nbsp; &amp;nbsp;var onYearValidity = new Date(new Date().setFullYear(new Date().getFullYear() + 1));&lt;BR /&gt;var newValidity = new Date(newValue);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if(newValidity &amp;gt; onYearValidity) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; // g_form.clearValue(validityField);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;g_form.showErrorBox(validityField,'Valid to date must be within a year from today');&lt;BR /&gt;&amp;nbsp; &amp;nbsp;} else {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;g_form.hideErrorBox(validityField);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&lt;BR /&gt;}&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 16:01:00 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833719#M1085858</guid>
      <dc:creator>Atchutaram</dc:creator>
      <dc:date>2024-02-20T16:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict knowledge article validity</title>
      <link>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833735#M1085863</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/387748"&gt;@Atchutaram&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is my weak area :(. I am not a developer.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/257473"&gt;@Jaspal Singh&lt;/a&gt;&amp;nbsp;&amp;nbsp;@Community Alums&amp;nbsp;any help here.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 16:12:30 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833735#M1085863</guid>
      <dc:creator>Dr Atul - LNG</dc:creator>
      <dc:date>2024-02-20T16:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict knowledge article validity</title>
      <link>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833754#M1085865</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/174084"&gt;@Dr Atul - LNG&lt;/a&gt;&amp;nbsp; for your assistance, i am also posting this as one more question with code. Thank you very much for extending the help.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 16:20:46 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833754#M1085865</guid>
      <dc:creator>Atchutaram</dc:creator>
      <dc:date>2024-02-20T16:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict knowledge article validity</title>
      <link>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833802#M1085884</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/174084"&gt;@Dr Atul - LNG&lt;/a&gt;&amp;nbsp;thanks &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/387748"&gt;@Atchutaram&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are 2 dates here one is article created date and another one is today's date so which of this 2 dates do you want to limit it to 1year ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's today's date then you can simply do it with UI policy using relative filter. If it's created (or published date) you have to use Client script and check if the date selected falls within the 365days since publish or created.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 16:47:19 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833802#M1085884</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2024-02-20T16:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Restrict knowledge article validity</title>
      <link>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833848#M1085893</link>
      <description>&lt;P&gt;Please see the script I posted on the other post you submitted -&amp;nbsp;&lt;A href="https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-valid-to-field/td-p/2833758" target="_blank"&gt;https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-valid-to-field/td-p/2833758&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 17:07:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/restrict-knowledge-article-validity/m-p/2833848#M1085893</guid>
      <dc:creator>Saloni Suthar</dc:creator>
      <dc:date>2024-02-20T17:07:02Z</dc:date>
    </item>
  </channel>
</rss>

