<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://sugarclub.sugarcrm.com/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>Retreiving the parent id in compose.js</title><link>https://sugarclub.sugarcrm.com/dev-club/f/questions-answers/490/retreiving-the-parent-id-in-compose-js</link><description>Hi All How can we retrieve the parent id in initialize function of the compose.js file in Email subpanel of Cases module. I have copied compose.js to /&amp;lt;&amp;gt;/custom/modules/Emails/clients/base/views/compose.js and used console.log(&amp;#39;parent id &amp;#39;+this.model</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Retreiving the parent id in compose.js</title><link>https://sugarclub.sugarcrm.com/thread/12745?ContentTypeID=1</link><pubDate>Tue, 17 May 2016 16:53:35 GMT</pubDate><guid isPermaLink="false">5c521d64-519d-47a6-9065-134618b211bf:e8bcb8f2-b93f-4e2d-bdad-e11d84daff49</guid><dc:creator>Tevfik T&amp;#252;mer</dc:creator><description>&lt;p&gt;Hi Sidhu,&lt;/p&gt;&lt;p&gt;I played with compose.js a bit and i was able to get the related beans with following code;&lt;/p&gt;&lt;pre class="javascript"&gt;({
&amp;nbsp;&amp;nbsp;&amp;nbsp; extendsFrom: &amp;#39;RecordView&amp;#39;,


&amp;nbsp;&amp;nbsp;&amp;nbsp; initialize: function(options) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this._super(&amp;#39;initialize&amp;#39;, [options]);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var prepopulate = this.context.get(&amp;quot;prepopulate&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(&amp;quot;related&amp;quot;, prepopulate.related);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(&amp;quot;related ID&amp;quot;, prepopulate.related.get(&amp;quot;id&amp;quot;));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(&amp;quot;related Module&amp;quot;, prepopulate.related.get(&amp;quot;_module&amp;quot;));
&amp;nbsp;&amp;nbsp;&amp;nbsp; },
})
&lt;/pre&gt;&lt;div style="display:none;"&gt;&lt;/div&gt;&lt;p&gt;Let me know if this helps.&lt;/p&gt;&lt;p&gt;Regards&lt;/p&gt;&lt;p&gt;Tevfik T&amp;uuml;mer&lt;/p&gt;&lt;p&gt;Developer Support Engineer&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>