<?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 UI Action in the workspace - Ui Script or custom modal in Workspace Client Script in Next Experience forum</title>
    <link>https://www.servicenow.com/community/next-experience-forum/ui-action-in-the-workspace-ui-script-or-custom-modal-in/m-p/2740420#M2592</link>
    <description>&lt;P&gt;Hi all,&lt;BR /&gt;I am trying to make a UI Script working in the Workspace Client Script.&amp;nbsp;&lt;BR /&gt;I made the UI Page load inside the modal in the workspace, but there is no functionality on the buttons when loaded.&amp;nbsp;&lt;BR /&gt;This is the code in the UI Action.&amp;nbsp;&lt;BR /&gt;Script:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function assessRisk () {
	ScriptLoader.getScripts(['sn_risk_advanced.AssignFormUtils.jsdbx'], function() {
		sn_risk_advanced.AssignFormUtils.assignAssessorApprover();
	});
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Workspace client script&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function onClick() {
  var ui_page_id = '615212a0532300101bfbddeeff7b12a2';
    g_modal.showFrame({
        url: '/ui_page.do?sys_id=' + ui_page_id,
        title: 'Add Assessor and Approver',
        size: 'l',
    });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how it looks in the backend and also what is wanted in the workspace&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JonasVK_0-1700642425320.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/307250i1C7B7E8F6537E549/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JonasVK_0-1700642425320.png" alt="JonasVK_0-1700642425320.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I also tried to make a custom modal, but this doesn't seem to be working as expected.&amp;nbsp;&lt;BR /&gt;See the code for this below.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function onClick(g_form) {

    var fields = [
         {
            type: 'reference',
            name: 'name',
            label: getMessage('Assessor'),
            mandatory: true,
            reference: 'sys_user',
			value: g_form.getValue('name'),
			displayValue: g_form.getDisplayValue('name')
        },
		{
            type: 'reference',
            name: 'approver_id',
            label: getMessage('Approver'),
            mandatory: false,
            reference: 'sys_user',
            referringTable: 'sn_risk_advanced_event',
            referringRecordId: g_form.getUniqueValue(),
			value: g_form.getValue('approver_id'),
			displayValue: g_form.getDisplayValue('approver_id'),
			query : "roles=sn_risk_advanced.ara_approver^active=true^EQ",
        }
    ];

    g_modal.showFields({
        title: "Add Assessor and Approver",
        fields: fields,
        size: 'lg'
    }).then(function(fieldValues) {
        g_form.setValue('assessor_id', fieldValues.updatedFields[0].value);
        g_form.setValue('approver_id', fieldValues.updatedFields[2].value);
        g_form.save();
    });
}&lt;/LI-CODE&gt;&lt;P&gt;If anybody could help out, would be really appreciated,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Jonas&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Nov 2023 08:43:02 GMT</pubDate>
    <dc:creator>Jonas VK</dc:creator>
    <dc:date>2023-11-22T08:43:02Z</dc:date>
    <item>
      <title>UI Action in the workspace - Ui Script or custom modal in Workspace Client Script</title>
      <link>https://www.servicenow.com/community/next-experience-forum/ui-action-in-the-workspace-ui-script-or-custom-modal-in/m-p/2740420#M2592</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;I am trying to make a UI Script working in the Workspace Client Script.&amp;nbsp;&lt;BR /&gt;I made the UI Page load inside the modal in the workspace, but there is no functionality on the buttons when loaded.&amp;nbsp;&lt;BR /&gt;This is the code in the UI Action.&amp;nbsp;&lt;BR /&gt;Script:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function assessRisk () {
	ScriptLoader.getScripts(['sn_risk_advanced.AssignFormUtils.jsdbx'], function() {
		sn_risk_advanced.AssignFormUtils.assignAssessorApprover();
	});
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Workspace client script&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function onClick() {
  var ui_page_id = '615212a0532300101bfbddeeff7b12a2';
    g_modal.showFrame({
        url: '/ui_page.do?sys_id=' + ui_page_id,
        title: 'Add Assessor and Approver',
        size: 'l',
    });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how it looks in the backend and also what is wanted in the workspace&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JonasVK_0-1700642425320.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/307250i1C7B7E8F6537E549/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JonasVK_0-1700642425320.png" alt="JonasVK_0-1700642425320.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I also tried to make a custom modal, but this doesn't seem to be working as expected.&amp;nbsp;&lt;BR /&gt;See the code for this below.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function onClick(g_form) {

    var fields = [
         {
            type: 'reference',
            name: 'name',
            label: getMessage('Assessor'),
            mandatory: true,
            reference: 'sys_user',
			value: g_form.getValue('name'),
			displayValue: g_form.getDisplayValue('name')
        },
		{
            type: 'reference',
            name: 'approver_id',
            label: getMessage('Approver'),
            mandatory: false,
            reference: 'sys_user',
            referringTable: 'sn_risk_advanced_event',
            referringRecordId: g_form.getUniqueValue(),
			value: g_form.getValue('approver_id'),
			displayValue: g_form.getDisplayValue('approver_id'),
			query : "roles=sn_risk_advanced.ara_approver^active=true^EQ",
        }
    ];

    g_modal.showFields({
        title: "Add Assessor and Approver",
        fields: fields,
        size: 'lg'
    }).then(function(fieldValues) {
        g_form.setValue('assessor_id', fieldValues.updatedFields[0].value);
        g_form.setValue('approver_id', fieldValues.updatedFields[2].value);
        g_form.save();
    });
}&lt;/LI-CODE&gt;&lt;P&gt;If anybody could help out, would be really appreciated,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Jonas&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 08:43:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/next-experience-forum/ui-action-in-the-workspace-ui-script-or-custom-modal-in/m-p/2740420#M2592</guid>
      <dc:creator>Jonas VK</dc:creator>
      <dc:date>2023-11-22T08:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: UI Action in the workspace - Ui Script or custom modal in Workspace Client Script</title>
      <link>https://www.servicenow.com/community/next-experience-forum/ui-action-in-the-workspace-ui-script-or-custom-modal-in/m-p/2740750#M2600</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/360500"&gt;@Jonas VK&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Can you change your workspace client script to the below and check if it works.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function onClick(g_form) {
  var ui_page_id = '615212a0532300101bfbddeeff7b12a2';
yourFunction(datafromframe){
//Logic inside
g_form.submit('your_action_name');
}
    g_modal.showFrame({
        url: '/ui_page.do?sys_id=' + ui_page_id,
        title: 'Add Assessor and Approver',
        size: 'l',
        callback: function (op, data) {
				if (op)
					yourFunction(data);
			}
    });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2023 12:08:00 GMT</pubDate>
      <guid>https://www.servicenow.com/community/next-experience-forum/ui-action-in-the-workspace-ui-script-or-custom-modal-in/m-p/2740750#M2600</guid>
      <dc:creator>Dibyaratnam</dc:creator>
      <dc:date>2023-11-22T12:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: UI Action in the workspace - Ui Script or custom modal in Workspace Client Script</title>
      <link>https://www.servicenow.com/community/next-experience-forum/ui-action-in-the-workspace-ui-script-or-custom-modal-in/m-p/2780994#M2816</link>
      <description>&lt;P&gt;We have the similar requirement however unable to make a progress. We did tried your script&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/197971"&gt;@Dibyaratnam&lt;/a&gt;&amp;nbsp;however it shows ; error on the 3rd line.&lt;/P&gt;&lt;P&gt;is there any luck on this ask?&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/360500"&gt;@Jonas VK&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 16:53:54 GMT</pubDate>
      <guid>https://www.servicenow.com/community/next-experience-forum/ui-action-in-the-workspace-ui-script-or-custom-modal-in/m-p/2780994#M2816</guid>
      <dc:creator>Harpreet Walia</dc:creator>
      <dc:date>2024-01-04T16:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: UI Action in the workspace - Ui Script or custom modal in Workspace Client Script</title>
      <link>https://www.servicenow.com/community/next-experience-forum/ui-action-in-the-workspace-ui-script-or-custom-modal-in/m-p/2781547#M2824</link>
      <description>&lt;P&gt;What error are you getting, can you share screenshot ?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2024 05:27:04 GMT</pubDate>
      <guid>https://www.servicenow.com/community/next-experience-forum/ui-action-in-the-workspace-ui-script-or-custom-modal-in/m-p/2781547#M2824</guid>
      <dc:creator>Dibyaratnam</dc:creator>
      <dc:date>2024-01-05T05:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: UI Action in the workspace - Ui Script or custom modal in Workspace Client Script</title>
      <link>https://www.servicenow.com/community/next-experience-forum/ui-action-in-the-workspace-ui-script-or-custom-modal-in/m-p/2784160#M2836</link>
      <description>&lt;P&gt;Hi, I am trying to replicate the same "Assess Risk" button in the workspace but somehow could not do it. Any success regarding this?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 12:08:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/next-experience-forum/ui-action-in-the-workspace-ui-script-or-custom-modal-in/m-p/2784160#M2836</guid>
      <dc:creator>Bharti Choudhar</dc:creator>
      <dc:date>2024-01-08T12:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: UI Action in the workspace - Ui Script or custom modal in Workspace Client Script</title>
      <link>https://www.servicenow.com/community/next-experience-forum/ui-action-in-the-workspace-ui-script-or-custom-modal-in/m-p/3166430#M5327</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/360500"&gt;@Jonas VK&lt;/a&gt;&amp;nbsp;Was this resolved?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2025 07:29:37 GMT</pubDate>
      <guid>https://www.servicenow.com/community/next-experience-forum/ui-action-in-the-workspace-ui-script-or-custom-modal-in/m-p/3166430#M5327</guid>
      <dc:creator>SaurabGidwani</dc:creator>
      <dc:date>2025-02-03T07:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: UI Action in the workspace - Ui Script or custom modal in Workspace Client Script</title>
      <link>https://www.servicenow.com/community/next-experience-forum/ui-action-in-the-workspace-ui-script-or-custom-modal-in/m-p/3166466#M5330</link>
      <description>&lt;P&gt;Don't remember the exact details, but we fixed it by using a GlideAjax script include that did most the work for us.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Jonas&lt;/P&gt;</description>
      <pubDate>Mon, 03 Feb 2025 07:46:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/next-experience-forum/ui-action-in-the-workspace-ui-script-or-custom-modal-in/m-p/3166466#M5330</guid>
      <dc:creator>Jonas VK</dc:creator>
      <dc:date>2025-02-03T07:46:34Z</dc:date>
    </item>
  </channel>
</rss>

