<?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>Run Action from Relationship</title><link>https://www.aras.com/community/f/development/36300/run-action-from-relationship</link><description>I have an Itemtype A and a relationship to Itemtype B 
 On the Main grid of ItemType B I have an action which works perfectly fine 
 On Itemtype A in the relationship Grid where there is ItemType B if i place my action there It does not work. I was wondering</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: Run Action from Relationship</title><link>https://www.aras.com/community/thread/6371?ContentTypeID=1</link><pubDate>Mon, 15 Feb 2021 12:50:08 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:4e556701-c61c-45a0-8d11-2c4dbd2350bb</guid><dc:creator>Gopikrishnan</dc:creator><description>&lt;p&gt;I&amp;#39;m not sure of what ID you want to pass but if you want to get the Item type B, item ID you can use below code&lt;/p&gt;
&lt;p&gt;var wnd = aras.getMainWindow();&lt;br /&gt;var topWnd = aras.getMostTopWindowWithAras(window);&lt;br /&gt;wnd = wnd === topWnd ? wnd.main : topWnd;&lt;br /&gt;var selectedIds;&lt;br /&gt;&lt;strong&gt;if (wnd.parent.main)&lt;/strong&gt;&amp;nbsp;//For Main Grid&lt;br /&gt;{&lt;br /&gt; selectedIds = wnd.parent.main.work.grid.getSelectedItemIds();&lt;br /&gt;} &lt;br /&gt;else&amp;nbsp; // For Relationship Grid&lt;br /&gt;{&lt;br /&gt; selectedIds = [wnd.itemID];&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Gobikrishnan R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>