<?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 Mobile agent Doubt in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/mobile-agent-doubt/m-p/3049860#M1146786</link>
    <description>&lt;P&gt;&lt;BR /&gt;Hi my requirement is&amp;nbsp; In mobile agent there's a state field&amp;nbsp; by default needs to display 2 values(In stock and deploy)and other fields needs to be hidden the below client script is working good in desktop but in mobile agent not working as excepted&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(function onLoad() {
var allowedStates = [6, 1]; // 6 = 'In Stock', 1 = 'Deployed'

var allStateValues = [2, 6, 9, 1, 10, 3, 7, 8, 11]; //state values;
for (var i = 0; i &amp;lt; allStateValues.length; i++) {
var state1 = allStateValues[i];
if (allowedStates.indexOf(state1) === -1) {
g_form.removeOption('state', state1);
}
}

})();&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Sep 2024 10:34:31 GMT</pubDate>
    <dc:creator>Bruce lee</dc:creator>
    <dc:date>2024-09-19T10:34:31Z</dc:date>
    <item>
      <title>Mobile agent Doubt</title>
      <link>https://www.servicenow.com/community/developer-forum/mobile-agent-doubt/m-p/3049860#M1146786</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hi my requirement is&amp;nbsp; In mobile agent there's a state field&amp;nbsp; by default needs to display 2 values(In stock and deploy)and other fields needs to be hidden the below client script is working good in desktop but in mobile agent not working as excepted&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(function onLoad() {
var allowedStates = [6, 1]; // 6 = 'In Stock', 1 = 'Deployed'

var allStateValues = [2, 6, 9, 1, 10, 3, 7, 8, 11]; //state values;
for (var i = 0; i &amp;lt; allStateValues.length; i++) {
var state1 = allStateValues[i];
if (allowedStates.indexOf(state1) === -1) {
g_form.removeOption('state', state1);
}
}

})();&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 10:34:31 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/mobile-agent-doubt/m-p/3049860#M1146786</guid>
      <dc:creator>Bruce lee</dc:creator>
      <dc:date>2024-09-19T10:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: Mobile agent Doubt</title>
      <link>https://www.servicenow.com/community/developer-forum/mobile-agent-doubt/m-p/3050121#M1146871</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/517119"&gt;@Bruce lee&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make a &lt;STRONG&gt;Catalog Client Script&lt;/STRONG&gt; work in both desktop and mobile views (including mobile agent), you need to adjust the &lt;STRONG&gt;UI Type&lt;/STRONG&gt; of the script and ensure it's optimized for mobile.&lt;/P&gt;&lt;H3&gt;Steps to Address Your Requirement:&lt;/H3&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Set UI Type to "All" in the Catalog Client Script&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;When you create the Catalog Client Script, you’ll notice an option called &lt;STRONG&gt;UI Type&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;By default, it may be set to &lt;STRONG&gt;Desktop&lt;/STRONG&gt;, but you can change it to &lt;STRONG&gt;All&lt;/STRONG&gt; to ensure the script works for both desktop and mobile.&lt;/LI&gt;&lt;LI&gt;Navigate to the Catalog Client Script and set &lt;STRONG&gt;UI Type&lt;/STRONG&gt; to &lt;STRONG&gt;All&lt;/STRONG&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-09-19 at 7.26.16 PM.png" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/387493i8D851E888F4CBE91/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-09-19 at 7.26.16 PM.png" alt="Screenshot 2024-09-19 at 7.26.16 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please Make the Changes and if the Issue is Resolved , Please mark as Helpful and accept the Solution&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks Regards&lt;/P&gt;&lt;P&gt;Badrinarayan&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 14:05:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/mobile-agent-doubt/m-p/3050121#M1146871</guid>
      <dc:creator>Badrinarayan</dc:creator>
      <dc:date>2024-09-19T14:05:43Z</dc:date>
    </item>
  </channel>
</rss>

