SugarCRM Custom Query in popup list

我是研究僧i 提交于 2019-12-11 11:23:52

问题


I need to customize the list of element shows in a popupview based on a relation.

I have these modules:

A->x (one-to-many)
A->y (one-to-many)

x have a related field to y

In detailview of A, a have the subpanels for x and y modules and I can create new x records and y records from quickcreateview. In quickcreateview for y, I have to select by popupview an x element.

I have to customize this popupview for showing only x items that have relation with current (this detailview) A record (not all)

This solution is valid for me: How I can customize query in view.popup in SugarCRM but I need to create a query with a dynamic param with A.id


回答1:


Solved. In quickcreatedefs(in my example module 'y'), in related field to 'x' add:

'displayParams' => array(
        'initial_filter' => "&linea_id=".$_REQUEST['parent_id'],
         ),

$_REQUEST['parent_id'] is id of 'A' module.

And in popupdefa(in my example module 'x'), add:

'whereStatement'=> " id IN (SELECT presu_line9cc5aterial_idb from presu_lineastesmaterial_c where presu_line9fedupuesto_ida='".$_REQUEST['linea_id']."' and deleted=0)",


来源:https://stackoverflow.com/questions/29687238/sugarcrm-custom-query-in-popup-list

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!