<?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: Show only days in duration field. in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640175#M297101</link>
    <description>&lt;P&gt;Did you get chance to look into this code?&lt;/P&gt;
&lt;P&gt;Hit Helpful or Correct on the impact of response.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Tushar&lt;BR /&gt;www.DxSherpa.com&lt;/P&gt;</description>
    <pubDate>Fri, 01 Jun 2018 13:59:22 GMT</pubDate>
    <dc:creator>Tushar Sharma2</dc:creator>
    <dc:date>2018-06-01T13:59:22Z</dc:date>
    <item>
      <title>Show only days in duration field.</title>
      <link>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640171#M297097</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;
&lt;P&gt;I want to make only days&amp;nbsp; from the duration field to be visible and hide the hours min and second.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As shown in below screenshot I want to hide highlighted field.&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/187874i686253370CB24C89/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/187874i686253370CB24C89/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Can anybody help here.&lt;/P&gt;
&lt;P&gt;Thanks in advance,&lt;/P&gt;
&lt;P&gt;_kP&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 11:10:00 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640171#M297097</guid>
      <dc:creator>kshitij patil</dc:creator>
      <dc:date>2018-05-23T11:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Show only days in duration field.</title>
      <link>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640172#M297098</link>
      <description>&lt;P&gt;Hello KP,&lt;/P&gt;
&lt;P&gt;You can achieve this by setting "max_unit" attribute in the dictionary of Remaining Effort field.&lt;/P&gt;
&lt;PRE class="prettyprint prettyprinted"&gt;&lt;BR /&gt;1.Right click on duration field.&lt;BR /&gt;2.Goto configure dictionary.&lt;BR /&gt;3.Click advance ui action under related links.&lt;BR /&gt;4.Add &lt;SPAN class="pln"&gt;max_unit&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=days&lt;/SPAN&gt; in the Attribute field.&lt;BR /&gt;5.save the record.&lt;BR /&gt;&lt;BR /&gt;Let me know if you have any question.&lt;/PRE&gt;
&lt;P&gt;Hit Helpful or Correct on the impact of response.&lt;BR /&gt;-Tushar&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 11:30:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640172#M297098</guid>
      <dc:creator>Tushar Sharma2</dc:creator>
      <dc:date>2018-05-23T11:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Show only days in duration field.</title>
      <link>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640173#M297099</link>
      <description>&lt;P&gt;Hi Tushar,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Its not working for days, for minutes its working but not for days&lt;/P&gt;
&lt;P&gt;To show only days, how its achievable , can you point out...&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Attribute set for minutes&lt;/STRONG&gt;&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/187872iB9EFC8BABE7A42F5/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/187872iB9EFC8BABE7A42F5/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="find_real_file.png" alt="find_real_file.png" /&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;&lt;STRONG&gt;Duration field converted to Minutes&lt;/STRONG&gt;&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/187873iC11A558EB0F2D0B6/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/187873iC11A558EB0F2D0B6/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Attribute set for days&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&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/187877i69CE09E13E7B7304/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/187877i69CE09E13E7B7304/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;But its not showing only days:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&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/187879i53B27219BF9D66C8/image-size/large?v=v2&amp;amp;px=999" srcset="/community/image/serverpage/image-id/187879i53B27219BF9D66C8/image-size/large?v=v2&amp;amp;px=999 1.0x" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 03:44:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640173#M297099</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2018-06-01T03:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Show only days in duration field.</title>
      <link>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640174#M297100</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Try below code on On-load client Script for duration field to hide hours, min and sec:&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;function onLoad() 
{
 document.getElementsByClassName('col-xs-7 col-sm-12 col-md-12 col-lg-8 no-left-padding-lg')[0].style.display='none';
}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know the result.&lt;/P&gt;
&lt;P&gt;Hit Helpful or Correct on the impact of response.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Tushar&lt;BR /&gt;www.DxSherpa.com&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 06:07:40 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640174#M297100</guid>
      <dc:creator>Tushar Sharma2</dc:creator>
      <dc:date>2018-06-01T06:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Show only days in duration field.</title>
      <link>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640175#M297101</link>
      <description>&lt;P&gt;Did you get chance to look into this code?&lt;/P&gt;
&lt;P&gt;Hit Helpful or Correct on the impact of response.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Tushar&lt;BR /&gt;www.DxSherpa.com&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 13:59:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640175#M297101</guid>
      <dc:creator>Tushar Sharma2</dc:creator>
      <dc:date>2018-06-01T13:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Show only days in duration field.</title>
      <link>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640176#M297102</link>
      <description>&lt;P&gt;This works.&lt;/P&gt;
&lt;P&gt;But what about if there are multiple duration fields on form, how we can specifically do that.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 03:25:13 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640176#M297102</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2018-06-04T03:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Show only days in duration field.</title>
      <link>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640177#M297103</link>
      <description>&lt;P&gt;If you noticed in below code there is an array index number which will specify the index of duration field. In case of multiple duration field you need to specify the index number.&lt;/P&gt;
&lt;P&gt;document.getElementsByClassName('col-xs-7 col-sm-12 col-md-12 col-lg-8 no-left-padding-lg')&lt;STRONG&gt;[0]&lt;/STRONG&gt;.style.display='none';&lt;/P&gt;
&lt;P&gt;Hit Helpful or Correct on the impact of response.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Tushar&lt;BR /&gt;www.DxSherpa.com&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 06:03:46 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640177#M297103</guid>
      <dc:creator>Tushar Sharma2</dc:creator>
      <dc:date>2018-06-04T06:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Show only days in duration field.</title>
      <link>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640178#M297104</link>
      <description>&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 06:00:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640178#M297104</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2018-06-05T06:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Show only days in duration field.</title>
      <link>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640179#M297105</link>
      <description>&lt;P&gt;Could you please mark as a correct answer if it resolved your query for future reference.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Tushar&lt;BR /&gt;www.DxSherpa.com&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 06:26:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640179#M297105</guid>
      <dc:creator>Tushar Sharma2</dc:creator>
      <dc:date>2018-06-05T06:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Show only days in duration field.</title>
      <link>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640180#M297106</link>
      <description>&lt;P&gt;Correct can be marked by author only&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 07:38:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640180#M297106</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2018-06-05T07:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Show only days in duration field.</title>
      <link>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640181#M297107</link>
      <description>&lt;P&gt;This logic is not working tushar any idea&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 11:14:59 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640181#M297107</guid>
      <dc:creator>Shantharao</dc:creator>
      <dc:date>2020-05-07T11:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Show only days in duration field.</title>
      <link>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640182#M297108</link>
      <description>&lt;P&gt;Hello KP,&lt;/P&gt;
&lt;P&gt;I have checked with max_unit=days and its seems that attribute will not work with Days. To achieve this you need to write below onload client script. You just need to Replace TABLE_NAME with your table name(for eg: 'u_test') and FEILD_NAME with your duration field name (for eg : 'u_duration_field').&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;function onLoad() {
 
g_form.getElement('ni.TABLE_NAME.FIELD_NAMEdur_hour').style.display='none';
g_form.getElement('ni.TABLE_NAME.FIELD_NAMEdur_sec').style.display='none';
g_form.getElement('ni.TABLE_NAME.FIELD_NAMEdur_min').style.display='none';


}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="ng-scope"&gt;Hit Helpful or Correct on the impact of response.&lt;/P&gt;
&lt;P class="ng-scope"&gt;Regards,&lt;BR /&gt;Tushar&lt;BR /&gt;www.DxSherpa.com&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 12:37:16 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640182#M297108</guid>
      <dc:creator>Tushar Sharma2</dc:creator>
      <dc:date>2020-05-07T12:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Show only days in duration field.</title>
      <link>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640183#M297109</link>
      <description>&lt;P&gt;I have submitted an idea for this feature, if you'd like to upvote:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.servicenow.com/community?id=view_idea&amp;amp;sysparm_idea_id=353bc6a31bea8910c790ece6b04bcb82&amp;amp;sysparm_idea_table=x_snc_com_ideation_idea&amp;amp;sysparm_module_id=enhancement_requests"&gt;https://community.servicenow.com/community?id=view_idea&amp;amp;sysparm_idea_id=353bc6a31bea8910c790ece6b04bcb82&amp;amp;sysparm_idea_table=x_snc_com_ideation_idea&amp;amp;sysparm_module_id=enhancement_requests&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 09:35:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640183#M297109</guid>
      <dc:creator>Thomas Wright1</dc:creator>
      <dc:date>2022-04-05T09:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: Show only days in duration field.</title>
      <link>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640184#M297110</link>
      <description>&lt;P&gt;Below code helped us:&lt;/P&gt;
&lt;P&gt;function onload{&lt;/P&gt;
&lt;P&gt;var a = document.getElementsByClassName('col-xs-7 col-sm-12 col-md-12 col-lg-8 no-left-padding-lg');&lt;/P&gt;
&lt;P&gt;a&lt;STRONG&gt;[0]&lt;/STRONG&gt;.style.display='none';&lt;/P&gt;
&lt;P&gt;a&lt;STRONG&gt;[1]&lt;/STRONG&gt;.style.display='none';&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can increment the value based on number of duration field on the form.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 14:38:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/show-only-days-in-duration-field/m-p/1640184#M297110</guid>
      <dc:creator>Shilpa16</dc:creator>
      <dc:date>2022-08-17T14:38:22Z</dc:date>
    </item>
  </channel>
</rss>

