<?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>How to close relationship search dialog box dynamically?</title><link>https://www.aras.com/community/f/development/6151/how-to-close-relationship-search-dialog-box-dynamically</link><description>Hi Team, 
 I have custom result binding code on &amp;#39;OnSearch&amp;#39; event. On return of result if it is true it works fine but on false I want to close search dialog box that appear in relationship on click of pick related dynamically. 
 I tried following method</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to close relationship search dialog box dynamically?</title><link>https://www.aras.com/community/thread/3194?ContentTypeID=1</link><pubDate>Fri, 12 Jul 2019 08:29:53 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:b786d362-2439-4bc3-ad54-028ef310c665</guid><dc:creator>cogres</dc:creator><description>&lt;p&gt;Hi Gaurav,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the clarification!&lt;/p&gt;
&lt;p&gt;Since you did not open the dialog from your own custom code, closing it might be a bit trickier. I&amp;#39;ve played around with it a little bit, but the only thing I found was the kind of hacky&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;document.getElementsByTagName(&amp;quot;dialog&amp;quot;)[0].close();&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It worked for me in a setup similar to yours (note: I tested this on Innovator 12.0). My onSearchDialog method simply contained&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;alert(&amp;quot;hi&amp;quot;);&lt;br /&gt;document.getElementsByTagName(&amp;quot;dialog&amp;quot;)[0].close();&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and when clicking &amp;quot;Pick related&amp;quot;, it opened the dialog, alerted &amp;quot;hi&amp;quot; and then closed the search dialog.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Obsiously this approach is not very robust, but maybe it can serve as a starting point for you? Maybe you can find a way to uniquely identify the dialog you opened in your setup (&lt;span&gt;document.getElementsByTagName(&amp;quot;dialog&amp;quot;)[0] makes me feel kind of uneasy), but I couldn&amp;#39;t find anything else so far.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Maybe someone else knows a more solid approach.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Cheers,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;C&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to close relationship search dialog box dynamically?</title><link>https://www.aras.com/community/thread/3192?ContentTypeID=1</link><pubDate>Fri, 12 Jul 2019 04:05:03 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:c73d3ac0-f855-46dd-8c25-44ae57883edb</guid><dc:creator>Former Member</dc:creator><description>&lt;p&gt;Hi Cogres,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Senario:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I am using aras innovator 11 SP 12. I have Itemtype A and Itemtype B. Created relationship of Itemtype A in Itemtype B. In related_id property of relationship Itemtype I have wrote one client method for &amp;quot;OnSearchDialog&amp;quot; event. Method is totally running fine. Now I have to put one validation, on satisfying false condition I want to close Search Dialog box dynamically through code. I have tried following different option to close Dialog but it is not working&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1.)&amp;nbsp;&amp;nbsp;&lt;span&gt;parent.dialog.close();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2.) this.args.dialog.close();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Following is my method that check and validate condition and execute code&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;----Method Code(Client Side)----&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;bool Result = false; //this is getting initialized&amp;nbsp;dynamically. Currently assuming it has false value&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If(Result)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;//Do Something&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;else&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;{&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp;close(); //Need to close Search dialog box on satisfying false condition. Tried above options too.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to close relationship search dialog box dynamically?</title><link>https://www.aras.com/community/thread/3190?ContentTypeID=1</link><pubDate>Thu, 11 Jul 2019 12:40:12 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:e17b0595-f81b-462a-9293-2770a93e2057</guid><dc:creator>cogres</dc:creator><description>&lt;p&gt;Hi Gaurav,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;your problem sounds quite interesting. Unfortunately, I don&amp;#39;t quite understand it completely. Could you provide some more details about your setup, please? Do you have a client event onClick of the &amp;quot;Pick related&amp;quot; button in the standard relationship grid? Could you share/explain some of the code that you implemented, as well?&lt;/p&gt;
&lt;p&gt;If you opened the search dialogue with custom code (and with some onSearchDialog event from a&amp;nbsp;sourcePropertyName parameter that contains your business logic) it should be straightforward to close that window in your custom code as well. Seeing as you have this problem, I assume your setup is different, which is why I&amp;#39;m asking :).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>