<?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: Schedule Entry Start/End Date in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/schedule-entry-start-end-date/m-p/1663159#M320085</link>
    <description>&lt;P&gt;Hi Solon,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; I think u can increase the year.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;For catalog i use to increase 30 days based on current day using below business rule.Please have a look it may helps for u.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;function onBefore(current, previous) {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; //This function will be automatically called when this rule is processed.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; var anActualDate = new GlideDateTime();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;anActualDate.setDisplayValue(current.request_item.variable_pool.u_employee_leaving.getDisplayValue()); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var datePlusOne = anActualDate.getNumericValue(); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;datePlusOne += (1000*60*60*840); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.due_date.setDateNumericValue(datePlusOne);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 22 Jan 2016 14:05:07 GMT</pubDate>
    <dc:creator>Nana5</dc:creator>
    <dc:date>2016-01-22T14:05:07Z</dc:date>
    <item>
      <title>Schedule Entry Start/End Date</title>
      <link>https://www.servicenow.com/community/developer-forum/schedule-entry-start-end-date/m-p/1663154#M320080</link>
      <description>&lt;P&gt;Hi, Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to get the &amp;nbsp; start/end date in current year, for example, I have a schedule set as:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/198492i92B3B3B3BDC62182/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I call &lt;EM&gt;schedule_entry.start_date_time&lt;/EM&gt;, it returns '&lt;SPAN style="color: #e23d39;"&gt;&lt;STRONG&gt;2014&lt;/STRONG&gt;&lt;/SPAN&gt;-10-21', which I actually want &lt;SPAN style="color: #e23d39;"&gt;&lt;STRONG&gt;2016&lt;/STRONG&gt;&lt;/SPAN&gt;-10-21.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know if there is any oob function I can use to get the updated data? Or I have to calculate through custom script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestion would be appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 20:22:58 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/schedule-entry-start-end-date/m-p/1663154#M320080</guid>
      <dc:creator>solonxu</dc:creator>
      <dc:date>2016-01-21T20:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule Entry Start/End Date</title>
      <link>https://www.servicenow.com/community/developer-forum/schedule-entry-start-end-date/m-p/1663155#M320081</link>
      <description>&lt;P&gt;Solon,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;If you want the same date (day and month) but with the current year, I don't know that there is an out of the box function to do that. The only way I'm familiar is with plain javascript.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Using "var gDate = new GlideDate();" for example would return "2016-01-21", the current date. If you wanted to take, say, "2014-04-13" and make it "2016-04-13" that would require some scripting.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Can you explain a little more about what you're trying to do?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Jan 2016 20:53:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/schedule-entry-start-end-date/m-p/1663155#M320081</guid>
      <dc:creator>dhasselquist</dc:creator>
      <dc:date>2016-01-21T20:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule Entry Start/End Date</title>
      <link>https://www.servicenow.com/community/developer-forum/schedule-entry-start-end-date/m-p/1663156#M320082</link>
      <description>&lt;P&gt;Thank you Dylan. &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I setup a yearly-repeating schedule entry, like the screenshot I attached. If I submit a form today (created_on: 2016-01-20), I would like to compare this 'Created_on' date with the schedule entry (should be &lt;STRONG&gt;2016&lt;/STRONG&gt;-01-21 in this year). However if I use &lt;EM&gt;schedule_entry.start_date_time&lt;/EM&gt; it returns '&lt;STRONG&gt;2014&lt;/STRONG&gt;-01-21". &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I am wondering if there is a way I can get this year's date in this schedule without scripting. &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Jan 2016 21:06:03 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/schedule-entry-start-end-date/m-p/1663156#M320082</guid>
      <dc:creator>solonxu</dc:creator>
      <dc:date>2016-01-21T21:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule Entry Start/End Date</title>
      <link>https://www.servicenow.com/community/developer-forum/schedule-entry-start-end-date/m-p/1663157#M320083</link>
      <description>&lt;P&gt;I haven't really used schedules much out of the box, so forgive me if I'm misunderstanding.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;What I am trying to figure out is why you need to do a comparison on the year of the day specified in the schedule.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Jan 2016 22:05:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/schedule-entry-start-end-date/m-p/1663157#M320083</guid>
      <dc:creator>dhasselquist</dc:creator>
      <dc:date>2016-01-21T22:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule Entry Start/End Date</title>
      <link>https://www.servicenow.com/community/developer-forum/schedule-entry-start-end-date/m-p/1663158#M320084</link>
      <description>&lt;P&gt;OK, for example, we want all ticket with Start Date (u_start_date) in following time window to be marked as 'Emergency':&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Dec 25 - Jan 3rd&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;July 4 - July 7&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Sep 1 - Sep 3&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;System admin (with no scripting knowledge) should have the ability to add/edit time window entry, what would you suggest to do?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Jan 2016 03:32:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/schedule-entry-start-end-date/m-p/1663158#M320084</guid>
      <dc:creator>solonxu</dc:creator>
      <dc:date>2016-01-22T03:32:44Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule Entry Start/End Date</title>
      <link>https://www.servicenow.com/community/developer-forum/schedule-entry-start-end-date/m-p/1663159#M320085</link>
      <description>&lt;P&gt;Hi Solon,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; I think u can increase the year.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;For catalog i use to increase 30 days based on current day using below business rule.Please have a look it may helps for u.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;function onBefore(current, previous) {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; //This function will be automatically called when this rule is processed.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; var anActualDate = new GlideDateTime();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;anActualDate.setDisplayValue(current.request_item.variable_pool.u_employee_leaving.getDisplayValue()); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var datePlusOne = anActualDate.getNumericValue(); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;datePlusOne += (1000*60*60*840); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.due_date.setDateNumericValue(datePlusOne);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Jan 2016 14:05:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/schedule-entry-start-end-date/m-p/1663159#M320085</guid>
      <dc:creator>Nana5</dc:creator>
      <dc:date>2016-01-22T14:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Schedule Entry Start/End Date</title>
      <link>https://www.servicenow.com/community/developer-forum/schedule-entry-start-end-date/m-p/1663160#M320086</link>
      <description>&lt;P&gt;My understanding of schedules is that they are used with/for SLA's and inactivity monitors. I don't think this is necessarily the best way to approach what you are trying to solve.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I'm just throwing stuff out here, others can weigh in, but I would do this kind of thing via data lookup rules or business rule. In this specific circumstance you could do it without scripting, by creating an on insert business rule. You could then specify in the condition builder if the Opened (opened_at) or created was on or between two date times. However, you would run into the same problem of having to maintain these dates by modifying them to reflect the current year, or scripting it.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;This is my "back of the envelope" idea, but if I HAD to write a script, I would do something similar to the below and put it in an insert business rule.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;//First we need the list of day/month that will be specicifed. Make sure day and month are two digits separated by a "-".&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var highPriority = ["12-25","12-26","12-27","12-28","12-29","12-30",&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "12-31","01-01","01-02","01-03","07-04","07-05",&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "07-06", "07-07","08-01","08-02","08-03","01-22"];&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;//dayMonth will return "dd-mm" for the current date. For example, today it would be "01-22"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var today = new GlideDate().toString();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var dayMonth = today.substring(today.length() - 5);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;//Check the contents of highPriority array to see if dayMonth matches&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;for (i=0;i&amp;lt;highPriority.length;i++){&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (highPriority[i] == dayMonth)&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Found a match, set the field and exit the loop&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; current.urgency = 1;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;In my example I set urgency to be high, but this would be whatever you needed.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Can anyone weigh in on this? I feel like there might/should be a way to do this OOTB.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Jan 2016 18:40:12 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/schedule-entry-start-end-date/m-p/1663160#M320086</guid>
      <dc:creator>dhasselquist</dc:creator>
      <dc:date>2016-01-22T18:40:12Z</dc:date>
    </item>
  </channel>
</rss>

