<?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: How to prevent users from setting State to On Hold in list views only? in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/how-to-prevent-users-from-setting-state-to-on-hold-in-list-views/m-p/3534260#M1254517</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/1104279"&gt;@aaronanders&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is onCellEdit Client script:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
    var saveAndClose = true;
    //Type appropriate comment here, and begin script below
	var viewName = g_list.getView();
    if (viewName == 'portal') { //System UI &amp;gt; Views
        alert('You are not authorized to update State Value "On Hold" in the Portal view.');
        saveAndClose = false;
    }
    callback(saveAndClose); // Returning false prevents the update
}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VishalJaswal_2-1777478051391.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/512817i5555CEE702EACFC8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VishalJaswal_2-1777478051391.png" alt="VishalJaswal_2-1777478051391.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Validation:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VishalJaswal_1-1777478023893.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/512816i52462BE0041189EC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VishalJaswal_1-1777478023893.png" alt="VishalJaswal_1-1777478023893.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Apr 2026 15:55:00 GMT</pubDate>
    <dc:creator>Vishal Jaswal</dc:creator>
    <dc:date>2026-04-29T15:55:00Z</dc:date>
    <item>
      <title>How to prevent users from setting State to On Hold in list views only?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-prevent-users-from-setting-state-to-on-hold-in-list-views/m-p/3534182#M1254501</link>
      <description>&lt;P&gt;Use case: Incidents moving to an on hold status in our instance has many mandatory fields to be filled out.&lt;BR /&gt;&lt;BR /&gt;We don't want to prevent agents from updating the state for Incident in list view altogether but we want to prevent them from doing this in list/portal list views.&lt;BR /&gt;&lt;BR /&gt;Data policies and business rules don't have access to your current view.&amp;nbsp; Without removing the ability to edit the State altogether in list view, how can this be managed?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2026 14:10:21 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-prevent-users-from-setting-state-to-on-hold-in-list-views/m-p/3534182#M1254501</guid>
      <dc:creator>aaronanders</dc:creator>
      <dc:date>2026-04-29T14:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent users from setting State to On Hold in list views only?</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-prevent-users-from-setting-state-to-on-hold-in-list-views/m-p/3534260#M1254517</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/1104279"&gt;@aaronanders&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here is onCellEdit Client script:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
    var saveAndClose = true;
    //Type appropriate comment here, and begin script below
	var viewName = g_list.getView();
    if (viewName == 'portal') { //System UI &amp;gt; Views
        alert('You are not authorized to update State Value "On Hold" in the Portal view.');
        saveAndClose = false;
    }
    callback(saveAndClose); // Returning false prevents the update
}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VishalJaswal_2-1777478051391.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/512817i5555CEE702EACFC8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VishalJaswal_2-1777478051391.png" alt="VishalJaswal_2-1777478051391.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Validation:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VishalJaswal_1-1777478023893.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/512816i52462BE0041189EC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VishalJaswal_1-1777478023893.png" alt="VishalJaswal_1-1777478023893.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2026 15:55:00 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-prevent-users-from-setting-state-to-on-hold-in-list-views/m-p/3534260#M1254517</guid>
      <dc:creator>Vishal Jaswal</dc:creator>
      <dc:date>2026-04-29T15:55:00Z</dc:date>
    </item>
  </channel>
</rss>

