弹出列表中的 SugarCRM 自定义查询 [英] SugarCRM Custom Query in popup list

查看:26
本文介绍了弹出列表中的 SugarCRM 自定义查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要根据关系自定义弹出视图中显示的元素列表.

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

我有这些模块:

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

x 有一个与 y

A的detailview中,有xy模块的子面板,我可以创建新的x> 记录和来自 quickcreateview 的 y 记录.在 y 的 quickcreateview 中,我必须通过 popupview 选择一个 x 元素.

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.

我必须自定义此弹出视图以仅显示与当前(此详细信息视图)A 记录(并非全部)相关的 x

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

此解决方案对我有效:我如何可以在SugarCRM的view.popup中自定义查询但我需要使用 A.id

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

推荐答案

已解决.在quickcreatedefs(在我的示例模块'y')中,在'x'的相关字段中添加:

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'] 是 'A' 模块的 id.

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

在 popupdefa(在我的示例模块x"中)中,添加:

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)",

这篇关于弹出列表中的 SugarCRM 自定义查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆