<?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: i want to make assigned to mandatory in Member Feedback forum</title>
    <link>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3137632#M3585</link>
    <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/95185"&gt;@PRAGHATIESH S&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please remember this is an OOB UI Action and if you update it then during upgrade it will be skipped&lt;/P&gt;
&lt;P&gt;is it for native or workspace that you want to make it mandatory?&lt;/P&gt;
&lt;P&gt;Client Script:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;function closeInteraction() {

	if(g_form.getValue('assigned_to') == ''){
		g_form.addInfoMessage('Please fill assigned to');
		g_form.setMandatory('assigned_to', true);
		return;
	}

	var dialog = new GlideModal("close_confirmation");
	var msg = getMessage('Confirmation');
	dialog.setTitle(msg);
	dialog.setPreference("sys_id", g_form.getUniqueValue());
	dialog.render();
}&lt;/LI-CODE&gt;
&lt;P&gt;Workspace client script:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;function onClick(g_form) {

    getMessage("Are you sure you want to close this interaction?", function(msg) {

        if (g_form.getValue('assigned_to') == '') {
            g_form.addInfoMessage('Please fill assigned to');
            g_form.setMandatory('assigned_to', true);
            return;
        }

        g_modal.confirm(getMessage("Confirmation"), msg, function(confirmed) {
            if (confirmed) {
                g_form.setValue('state', 'closed_complete');
                g_form.save();
            }
        });
    });

    return false;
}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AnkurBawiskar_0-1735558823226.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/410156iF7C69754614AF2A8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AnkurBawiskar_0-1735558823226.png" alt="AnkurBawiskar_0-1735558823226.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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>Mon, 30 Dec 2024 11:40:51 GMT</pubDate>
    <dc:creator>Ankur Bawiskar</dc:creator>
    <dc:date>2024-12-30T11:40:51Z</dc:date>
    <item>
      <title>i want to make assigned to mandatory</title>
      <link>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3137566#M3579</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is OOB Ui action for interaction table "Close".&amp;nbsp; when we click on that close button it needs to make "assigned to" mandatory.&lt;BR /&gt;&lt;BR /&gt;can anyone let me know, how can i make changes on here.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PRAGHATIESHS_0-1735554766866.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/410143iF9276113D5205D1B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PRAGHATIESHS_0-1735554766866.png" alt="PRAGHATIESHS_0-1735554766866.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 10:34:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3137566#M3579</guid>
      <dc:creator>PRAGHATIESH S</dc:creator>
      <dc:date>2024-12-30T10:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: i want to make assigned to mandatory</title>
      <link>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3137571#M3580</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/95185"&gt;@PRAGHATIESH S&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can add code in UI action or better create a UI policy on interaction table where state = Closed and make assigned to mandatory.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 10:35:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3137571#M3580</guid>
      <dc:creator>Dr Atul G- LNG</dc:creator>
      <dc:date>2024-12-30T10:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: i want to make assigned to mandatory</title>
      <link>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3137574#M3581</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/174084"&gt;@Dr Atul G- LNG&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;i tried ui policy, but its not working when we click on close button.&lt;BR /&gt;I try to add the code on the UI Action, that is also not working&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 10:37:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3137574#M3581</guid>
      <dc:creator>PRAGHATIESH S</dc:creator>
      <dc:date>2024-12-30T10:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: i want to make assigned to mandatory</title>
      <link>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3137576#M3582</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/95185"&gt;@PRAGHATIESH S&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;could you please share both codes snippet.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 10:38:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3137576#M3582</guid>
      <dc:creator>Dr Atul G- LNG</dc:creator>
      <dc:date>2024-12-30T10:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: i want to make assigned to mandatory</title>
      <link>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3137583#M3583</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/174084"&gt;@Dr Atul G- LNG&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PRAGHATIESHS_2-1735555658646.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/410150i3E5314D9FBFF1325/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PRAGHATIESHS_2-1735555658646.png" alt="PRAGHATIESHS_2-1735555658646.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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 10:47:45 GMT</pubDate>
      <guid>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3137583#M3583</guid>
      <dc:creator>PRAGHATIESH S</dc:creator>
      <dc:date>2024-12-30T10:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: i want to make assigned to mandatory</title>
      <link>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3137612#M3584</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/95185"&gt;@PRAGHATIESH S&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I am not wrong, it looks like some changes have been done in UI Action, the OOTB code is different. Please make changes and then add your condition&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AGLearnNGrow_0-1735557768783.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/410155i593D51DF16DA21AD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AGLearnNGrow_0-1735557768783.png" alt="AGLearnNGrow_0-1735557768783.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 11:23:00 GMT</pubDate>
      <guid>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3137612#M3584</guid>
      <dc:creator>Dr Atul G- LNG</dc:creator>
      <dc:date>2024-12-30T11:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: i want to make assigned to mandatory</title>
      <link>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3137632#M3585</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/95185"&gt;@PRAGHATIESH S&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please remember this is an OOB UI Action and if you update it then during upgrade it will be skipped&lt;/P&gt;
&lt;P&gt;is it for native or workspace that you want to make it mandatory?&lt;/P&gt;
&lt;P&gt;Client Script:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;function closeInteraction() {

	if(g_form.getValue('assigned_to') == ''){
		g_form.addInfoMessage('Please fill assigned to');
		g_form.setMandatory('assigned_to', true);
		return;
	}

	var dialog = new GlideModal("close_confirmation");
	var msg = getMessage('Confirmation');
	dialog.setTitle(msg);
	dialog.setPreference("sys_id", g_form.getUniqueValue());
	dialog.render();
}&lt;/LI-CODE&gt;
&lt;P&gt;Workspace client script:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;function onClick(g_form) {

    getMessage("Are you sure you want to close this interaction?", function(msg) {

        if (g_form.getValue('assigned_to') == '') {
            g_form.addInfoMessage('Please fill assigned to');
            g_form.setMandatory('assigned_to', true);
            return;
        }

        g_modal.confirm(getMessage("Confirmation"), msg, function(confirmed) {
            if (confirmed) {
                g_form.setValue('state', 'closed_complete');
                g_form.save();
            }
        });
    });

    return false;
}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AnkurBawiskar_0-1735558823226.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/410156iF7C69754614AF2A8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AnkurBawiskar_0-1735558823226.png" alt="AnkurBawiskar_0-1735558823226.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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>Mon, 30 Dec 2024 11:40:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3137632#M3585</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2024-12-30T11:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: i want to make assigned to mandatory</title>
      <link>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3138093#M3594</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/95185"&gt;@PRAGHATIESH S&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope you are doing good.&lt;/P&gt;
&lt;P&gt;Did my reply answer your question?&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>Tue, 31 Dec 2024 04:40:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3138093#M3594</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2024-12-31T04:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: i want to make assigned to mandatory</title>
      <link>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3138100#M3595</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/95185"&gt;@PRAGHATIESH S&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use below code in workspace client script.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;getMessage("Are you sure you want to close this interaction?", function (msg) {
    g_modal.confirm(getMessage("Confirmation"), msg, function (confirmed) {
        if (confirmed) {
            // Check if "Assigned to" has a value
            if (!g_form.getValue('assigned_to')) {
                g_form.addErrorMessage("The 'Assigned to' field is mandatory. Please provide a value.");
                g_form.showFieldMsg('assigned_to', "This field is mandatory.", 'error');
                return false;
            }
            
            // Proceed to close the interaction
            g_form.setValue('state', 'closed_complete');
            g_form.save();
        }
    });
});

return false;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Runjay Patel - ServiceNow Solution Architect&lt;BR /&gt;YouTube: &lt;A href="https://www.youtube.com/@RunjayP" target="_blank"&gt;https://www.youtube.com/@RunjayP&lt;/A&gt;&lt;BR /&gt;LinkedIn: &lt;A href="https://www.linkedin.com/in/runjay" target="_blank"&gt;https://www.linkedin.com/in/runjay&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 05:01:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3138100#M3595</guid>
      <dc:creator>Runjay Patel</dc:creator>
      <dc:date>2024-12-31T05:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: i want to make assigned to mandatory</title>
      <link>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3138151#M3596</link>
      <description>&lt;P&gt;You need to create a data policy here. Do try and let me know&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2024 06:19:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/member-feedback-forum/i-want-to-make-assigned-to-mandatory/m-p/3138151#M3596</guid>
      <dc:creator>Omkar Mone</dc:creator>
      <dc:date>2024-12-31T06:19:41Z</dc:date>
    </item>
  </channel>
</rss>

