php - SugarCRM Get Last Email Date and Search on it -



php - SugarCRM Get Last Email Date and Search on it -

so have been working sugarcrm pretty extensively lately , need able display lastly date contact emailed search based on how long ago contact emailed.

i can create logic hook lastly email date cannot search based on value of that.

so looked in searchfields.php , found next code gets email of contact.

'email' => array ( 'query_type' => 'default', 'operator' => 'subquery', 'subquery' => 'select eabr.bean_id email_addr_bean_rel eabr bring together email_addresses ea on (ea.id = eabr.email_address_id) eabr.deleted=0 , ea.email_address like', 'db_field' => array ( 0 => 'id', ), ),

using info decided create new array next code lastly email date. need sorted or actual lastly email date if contact emailed multiple times point.

'last_email_c' => array ( 'query_type' => 'default', 'operator' => 'subquery', 'subquery' => 'select e.date_sent emails e e.parent_type = \'contacts\' , e.parent_id = \'{0}\'', 'db_field' => array ( 0 => 'id', ), ),

my issue is, don't know new subquery, checked in listviewdefs , searchdefs , cannot find reference either of these custom searchfields.

what missing?

try one. when utilize subquery have assume parameter form added end of subquery if search blah@blah.com sugar append subquery 'blah@blah.com%' operator way this

t_email_c' => array ( 'query_type' => 'default', 'operator' => 'subquery', 'subquery' => 'select e.date_sent emails e e.parent_type = \'contacts\' , e.parent_id ', 'db_field' => array ( 0 => 'id', ),

also should selecting id of parent record matched against parent record.

basically in subquery should selecting contact id lastly email date like.

if can't write query way need overwriting list.view actions.

php sugarcrm

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -