Artem Brat

Outputting fields to the ListView using the SQL query

Discussion created by Artem Brat on Jul 12, 2017
Latest reply on Jul 13, 2017 by André Lopes

Hello.

Sorry for my english.

SugarCRM 6.5.

I created new custom module (CustomModul, with the fields: id, name, name_org, inn_org). I output these fields in the ListView, DetalView.

\modules\CustomModul\metadata\listviewdefs.php

<?php

 if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

 $listViewDefs[CustomModul] = array (

'name'=> array (…),

'name_org => array (…),

'inn_org'=> array (…),

);

 

idnamename_orginn_org
123OrelSMU123456
234GusPTU654789

It is necessary to display sql_call_date, sql_call_res, sql_call_status. They should be obtained by executing an SQL query (for example: SELECT sql_call_date, sql_call_res, sql_call_status FROM CustomModul LEFT JOIN calls). How to display these fields in ListView (DetalView)? I do not know how to connect SQL query.

For example:

idnamename_orginn_orgsql_call_datesql_call_ressql_call_status
123OrelSMU12345601.07.2017positivelyphone
234GusPTU65478926.06.2017nophone

Thanks

Artem.

 

Outcomes