<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.aras.com/community/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Restricting Action on Multi select.</title><link>https://www.aras.com/community/f/development/4030/restricting-action-on-multi-select</link><description>Hi All,

Is there any way to restrict an action menu on multiselect of the item grid.

I found this article&amp;#160; https://community.aras.com/en/tech-tip-disable-menu-button-using-cui/ for restricting the built in actions such as &amp;quot;save as&amp;quot; , &amp;quot;lock&amp;quot; etc based</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: Restricting Action on Multi select.</title><link>https://www.aras.com/community/thread/2666?ContentTypeID=1</link><pubDate>Sun, 10 Mar 2019 11:29:15 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:72331591-5d88-4720-88ef-273d5cf8b069</guid><dc:creator>ShrutiS</dc:creator><description>&lt;p&gt;Thankyou...I am sure it will be helpful :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Restricting Action on Multi select.</title><link>https://www.aras.com/community/thread/2509?ContentTypeID=1</link><pubDate>Tue, 05 Feb 2019 16:33:09 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:86bb7773-6fd1-4039-9331-807a8f45b3dd</guid><dc:creator>Christopher Gillis</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;We&amp;#39;ve just published a new blog post on creating CUI buttons that are enabled/disabled based on some conditions. The example we used in the blog post was how to ensure that users can only run an action when multiple items are selected in the grid. You can find this blog here:&amp;nbsp;&lt;a href="/b/english/posts/conditional-cui-buttons"&gt;https://community.aras.com/b/english/posts/conditional-cui-buttons&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps!&lt;/p&gt;
&lt;p&gt;Chris&lt;/p&gt;
&lt;p&gt;Christopher Gillis&lt;/p&gt;
&lt;p&gt;Aras Labs Software Engineer&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Restricting Action on Multi select.</title><link>https://www.aras.com/community/thread/2264?ContentTypeID=1</link><pubDate>Wed, 21 Nov 2018 14:51:19 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:243627cd-aa44-4269-b94c-c0872766ec8c</guid><dc:creator>Christopher Gillis</dc:creator><description>Hello,

It&amp;#39;s not easily possible to disable this custom action as it doesn&amp;#39;t exist as a CUI item.

That being said, you can achieve a similar result by prompting the user with an error message if two or more items aren&amp;#39;t selected. You can do this by changing the action to an &lt;strong&gt;ItemType&lt;/strong&gt; action. This kind of action is always available from the main grid if you&amp;#39;re viewing an ItemType it&amp;#39;s attached to. You can then check for the number of selected items in the grid with a code sample like below.

&lt;pre&gt;&lt;code&gt;var selectedItems = window.work.grid.GetSelectedItemIDs();
if (selectedItems.length &amp;lt; 2) {
return aras.AlertWarning(&amp;quot;This action requires two or more items to be selected&amp;quot;);
}
// Put actual method logic below here&lt;/code&gt;&lt;/pre&gt;


Chris

&lt;hr /&gt;

Christopher Gillis

Aras Labs Software Engineer&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>