<?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: Limit the additional assignee list to only 2 users in Virtual Agent forum</title>
    <link>https://www.servicenow.com/community/virtual-agent-forum/limit-the-additional-assignee-list-to-only-2-users/m-p/2947358#M8274</link>
    <description>&lt;P&gt;Hi &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/267040"&gt;@Shree Nag&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this&amp;nbsp;&lt;/P&gt;&lt;P&gt;function onSubmit() {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; var assignees = g_form.getValue('YourFieldName').&lt;SPAN&gt;split(',');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if (assignees.length &amp;gt; 2) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g_form.showFieldMsg('YourFieldName', 'You cannot add more than 2 assignees.', 'error');&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; return&amp;nbsp;&lt;SPAN&gt;true;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If my answer helped you in any way, please mark it as helpful or correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 30 May 2024 02:17:22 GMT</pubDate>
    <dc:creator>Community Alums</dc:creator>
    <dc:date>2024-05-30T02:17:22Z</dc:date>
    <item>
      <title>Limit the additional assignee list to only 2 users</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/limit-the-additional-assignee-list-to-only-2-users/m-p/2947349#M8273</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Appreciate your help !&lt;BR /&gt;&lt;SPAN&gt;We have added Additional assignee list to incident form.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Now there is a requirement to limit the additional assignee to only 2 users.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;One cannot add more than 2 users to the list.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is that possible, If so could you please guide us on the steps to limit?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Shree&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 01:45:17 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/limit-the-additional-assignee-list-to-only-2-users/m-p/2947349#M8273</guid>
      <dc:creator>Shree Nag</dc:creator>
      <dc:date>2024-05-30T01:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Limit the additional assignee list to only 2 users</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/limit-the-additional-assignee-list-to-only-2-users/m-p/2947358#M8274</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/267040"&gt;@Shree Nag&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this&amp;nbsp;&lt;/P&gt;&lt;P&gt;function onSubmit() {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; var assignees = g_form.getValue('YourFieldName').&lt;SPAN&gt;split(',');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if (assignees.length &amp;gt; 2) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g_form.showFieldMsg('YourFieldName', 'You cannot add more than 2 assignees.', 'error');&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return false;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; return&amp;nbsp;&lt;SPAN&gt;true;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If my answer helped you in any way, please mark it as helpful or correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 02:17:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/limit-the-additional-assignee-list-to-only-2-users/m-p/2947358#M8274</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2024-05-30T02:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Limit the additional assignee list to only 2 users</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/limit-the-additional-assignee-list-to-only-2-users/m-p/2947373#M8276</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/267040"&gt;@Shree Nag&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below posts could be helpful :&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.servicenow.com/community/csm-forum/how-to-limit-the-list-collector-choices-selection/m-p/395537" target="_blank"&gt;https://www.servicenow.com/community/csm-forum/how-to-limit-the-list-collector-choices-selection/m-p/395537&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.servicenow.com/community/developer-blog/servicenow-learning-139-how-to-restrict-values-to-be-selected-in/ba-p/2780856" target="_blank"&gt;https://www.servicenow.com/community/developer-blog/servicenow-learning-139-how-to-restrict-values-to-be-selected-in/ba-p/2780856&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and Regards&lt;/P&gt;
&lt;P&gt;Amit Verma&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 02:48:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/limit-the-additional-assignee-list-to-only-2-users/m-p/2947373#M8276</guid>
      <dc:creator>vermaamit16</dc:creator>
      <dc:date>2024-05-30T02:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Limit the additional assignee list to only 2 users</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/limit-the-additional-assignee-list-to-only-2-users/m-p/2947384#M8277</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/267040"&gt;@Shree Nag&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can do this using 2 ways&lt;/P&gt;
&lt;P&gt;1) onChange on that field and check the length and show error message on form or field&lt;/P&gt;
&lt;P&gt;OR&lt;/P&gt;
&lt;P&gt;2) before update/insert BR and show error message&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2024 03:11:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/limit-the-additional-assignee-list-to-only-2-users/m-p/2947384#M8277</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2024-05-30T03:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: Limit the additional assignee list to only 2 users</title>
      <link>https://www.servicenow.com/community/virtual-agent-forum/limit-the-additional-assignee-list-to-only-2-users/m-p/2951430#M8404</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thank you all for the response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added the client script. The error message pops out when I'm adding more than 2 assignees, but I can still add the additional assignee to the bucket and I can update with more than 2 assignees.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What Am 'I missing in this client script, that avoids even adding the additional assignee to the bucket&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;function&lt;/SPAN&gt;&lt;SPAN&gt; onChange(control, oldValue, newValue, isLoading) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (isLoading || newValue == &lt;/SPAN&gt;&lt;SPAN&gt;''&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; values = g_form.getValue(&lt;/SPAN&gt;&lt;SPAN&gt;'additional_assignee_list'&lt;/SPAN&gt;&lt;SPAN&gt;).toString().split(&lt;/SPAN&gt;&lt;SPAN&gt;','&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (values.length &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; g_form.showFieldMsg(&lt;/SPAN&gt;&lt;SPAN&gt;'additional_assignee_list'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'You cannot add more than 2 assignees.'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'error'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;false&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;else&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks a lot for the help !&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 03 Jun 2024 19:54:12 GMT</pubDate>
      <guid>https://www.servicenow.com/community/virtual-agent-forum/limit-the-additional-assignee-list-to-only-2-users/m-p/2951430#M8404</guid>
      <dc:creator>Shree Nag</dc:creator>
      <dc:date>2024-06-03T19:54:12Z</dc:date>
    </item>
  </channel>
</rss>

