title: SugarCRM Custom Query in popup list
body: <p>I need to customize the list of element shows in a popupview based on a relation.</p>
  
  <p>I have these modules:</p>
  
  <pre><code>A-&gt;x (one-to-many)
  A-&gt;y (one-to-many)
  </code></pre>
  
  <p><code>x</code> have a related field to <code>y</code></p>
  
  <p>In detailview of <code>A</code>, a have the subpanels for <code>x</code> and <code>y</code> modules and I can create new <code>x</code> records and <code>y</code> records from quickcreateview.
  In quickcreateview for <code>y</code>, I have to select by popupview an <code>x</code> element.</p>
  
  <p>I have to customize this popupview for showing only <code>x</code> items that have relation with current (this detailview) A record (not all)</p>
  
  <p>This solution is valid for me: <a href="https://stackoverflow.com/questions/29285938/how-i-can-customize-query-in-view-popup-in-sugarcrm">How I can customize query in view.popup in SugarCRM</a>
  but I need to create a query with a dynamic param with <code>A.id</code></p>