<?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 button is not working in UI native in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/ui-action-button-is-not-working-in-ui-native/m-p/3513381#M1251241</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have one Reject button created in UI action, this button is working in workspace but same button is not working in native View.. It is throwing undefined onclick.. Shared the screenshot below. Please help me out..&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="manju12_0-1774330212811.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/507386iF36CAE8AB2D23BC4/image-size/medium?v=v2&amp;amp;px=400" alt="manju12_0-1774330212811.png" title="manju12_0-1774330212811.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Manju&lt;/P&gt;</description>
    <pubDate>Tue, 24 Mar 2026 05:30:57 GMT</pubDate>
    <dc:creator>manju12</dc:creator>
    <dc:date>2026-03-24T05:30:57Z</dc:date>
    <item>
      <title>Ui Action button is not working in UI native</title>
      <link>https://www.servicenow.com/community/developer-forum/ui-action-button-is-not-working-in-ui-native/m-p/3513381#M1251241</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have one Reject button created in UI action, this button is working in workspace but same button is not working in native View.. It is throwing undefined onclick.. Shared the screenshot below. Please help me out..&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="manju12_0-1774330212811.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/507386iF36CAE8AB2D23BC4/image-size/medium?v=v2&amp;amp;px=400" alt="manju12_0-1774330212811.png" title="manju12_0-1774330212811.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Manju&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2026 05:30:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/ui-action-button-is-not-working-in-ui-native/m-p/3513381#M1251241</guid>
      <dc:creator>manju12</dc:creator>
      <dc:date>2026-03-24T05:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Ui Action button is not working in UI native</title>
      <link>https://www.servicenow.com/community/developer-forum/ui-action-button-is-not-working-in-ui-native/m-p/3513383#M1251242</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/264597"&gt;@manju12&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The error&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;openCommentForControl is not defined&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;clearly indicates that the function used in your&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;UI Action onclick&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;not available in Native UI&lt;/STRONG&gt;, even though it works in Workspace.&lt;/P&gt;&lt;H1&gt;&lt;SPAN&gt;&lt;STRONG&gt;Root Cause&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/H1&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;The function is likely defined in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Workspace (UI Builder / Client Script)&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Native UI does&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;not load those scripts&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Hence, onclick fails with&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;undefined function&lt;/EM&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Step-by-Step Solution&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H2&gt;Step 1: Check UI Action Configuration&lt;/H2&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Go to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;System Definition → UI Actions&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Open your&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Reject button&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Verify:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Client = true&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Onclick:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;openCommentForControl&lt;/SPAN&gt;&lt;SPAN&gt;();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Step 2: Create Client Script for Native UI&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Go to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;System Definition → Client Scripts&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Click&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;New&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;H3&gt;Configure:&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Table: same as your UI Action table&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Type:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;onLoad&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H2&gt;Step 3: Define the Function&lt;/H2&gt;&lt;P&gt;Add this script:&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;function&lt;/SPAN&gt; &lt;SPAN class=""&gt;openCommentForControl&lt;/SPAN&gt;&lt;SPAN&gt;() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; &lt;SPAN class=""&gt;comment&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;prompt&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"Enter rejection comments:"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN class=""&gt;comment&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;g_form&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;setValue(&lt;/SPAN&gt;&lt;SPAN class=""&gt;'comments'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN class=""&gt;comment&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;This makes the function available in Native UI&lt;/P&gt;&lt;H2&gt;Step 4: Test the Button&lt;/H2&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Open the record in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Native UI&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Click&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Reject&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;It should now:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Prompt for comment&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Populate the field&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 24 Mar 2026 05:35:13 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/ui-action-button-is-not-working-in-ui-native/m-p/3513383#M1251242</guid>
      <dc:creator>ayushraj7012933</dc:creator>
      <dc:date>2026-03-24T05:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Ui Action button is not working in UI native</title>
      <link>https://www.servicenow.com/community/developer-forum/ui-action-button-is-not-working-in-ui-native/m-p/3513463#M1251260</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/264597"&gt;@manju12&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ensure right&amp;nbsp;client-side function scope.&lt;/P&gt;&lt;P&gt;because most times&amp;nbsp;it’s due to missing client-side function scope also the workspace loads modules differently than UI16.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also ensure&amp;nbsp;&lt;STRONG&gt;Client = true&amp;nbsp;&lt;/STRONG&gt;and scripted in this way :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2026-03-24 125302.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/507409iECB61C710AB2D4DC/image-dimensions/673x221?v=v2" alt="Screenshot 2026-03-24 125302.png" title="Screenshot 2026-03-24 125302.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;If my response helped mark as helpful and accept the solution.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2026 07:26:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/ui-action-button-is-not-working-in-ui-native/m-p/3513463#M1251260</guid>
      <dc:creator>yashkamde</dc:creator>
      <dc:date>2026-03-24T07:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: Ui Action button is not working in UI native</title>
      <link>https://www.servicenow.com/community/developer-forum/ui-action-button-is-not-working-in-ui-native/m-p/3513530#M1251272</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/264597"&gt;@manju12&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This issue is happening because the function &lt;STRONG&gt;openCustomControl()&lt;/STRONG&gt; is not available in the Native UI.&lt;/P&gt;&lt;P&gt;In Workspace, things work a bit differently; scripts can come from UI Builder or other sources, so even if the function isn’t in the UI Action itself, it may still work. But in the Native view, it strictly looks for that function inside the UI Action (or a loaded UI Script).&lt;/P&gt;&lt;P&gt;So when you click the button in Native UI, it tries to run openCustomControl() and fails, giving the “not defined” error.&lt;/P&gt;&lt;P&gt;To fix this, just make sure:&lt;/P&gt;&lt;P&gt;The UI Action is marked as &lt;STRONG&gt;Client = true&lt;/STRONG&gt;&lt;BR /&gt;The same function &lt;STRONG&gt;(openCustomControl)&lt;/STRONG&gt; is properly defined in the Script section of the UI Action, or available via a global UI Script&lt;/P&gt;&lt;P&gt;In short, I guess the function exists for Workspace but not for Native UI; that's why it breaks there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Refer to these documents; this may help you:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.servicenow.com/docs/r/application-development/ui-builder/using-ui-builder.html" target="_blank"&gt;https://www.servicenow.com/docs/r/application-development/ui-builder/using-ui-builder.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.servicenow.com/docs/r/security-management/security-incident-response/enable_workspace_form_ui_actions.html" target="_blank"&gt;https://www.servicenow.com/docs/r/security-management/security-incident-response/enable_workspace_form_ui_actions.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you find my answer useful, please mark it as helpful and correct.&amp;nbsp;‌‌‌‌‌‌‌‌‌‌‌&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Soham Tipnis&lt;BR /&gt;ServiceNow Developer ||&amp;nbsp; Technical Consultant&lt;BR /&gt;LinkedIn:&amp;nbsp;&lt;A href="http://www.linkedin.com/in/sohamtipnis10" target="_blank"&gt;www.linkedin.com/in/sohamtipnis10&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Mar 2026 08:56:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/ui-action-button-is-not-working-in-ui-native/m-p/3513530#M1251272</guid>
      <dc:creator>SohamTipnis</dc:creator>
      <dc:date>2026-03-24T08:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Ui Action button is not working in UI native</title>
      <link>https://www.servicenow.com/community/developer-forum/ui-action-button-is-not-working-in-ui-native/m-p/3514298#M1251400</link>
      <description>&lt;P&gt;If you find my response helpful or it resolves your issue, kindly mark it as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Helpful&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Accept the Solution&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;This helps others in the community quickly find the correct answer and improves overall knowledge sharing.&lt;/P&gt;&lt;P&gt;Thank you for your support!&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2026 10:13:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/ui-action-button-is-not-working-in-ui-native/m-p/3514298#M1251400</guid>
      <dc:creator>ayushraj7012933</dc:creator>
      <dc:date>2026-03-25T10:13:20Z</dc:date>
    </item>
  </channel>
</rss>

