AnsweredAssumed Answered

Using concat in custom vardef fields

Question asked by Brad Foster on May 3, 2017
Latest reply on May 3, 2017 by Brad Foster

I want to concat 2 values for the call name.  I can't use calculated fields or logic hooks because that doesn't work in multiple languages - it would only save one language to the DB.


Instead I need to overwrite the name vardef with


$dictionary["Call"]["fields"]["name"] =
array (
'name' => 'name',
'vname' => 'LBL_SUBJECT',
'dbType' => 'varchar',
'type' => 'name',
'len' => '255',
'fields'=> array(0=>'call_topic_c',1=>'subtopic_c'),
'source' => 'non-db',
'db_concat_fields'=> array(0=>'call_topic_c',1=>'subtopic_c'),
'comment' => 'Brief description of the call',
'importable' => 'required',


But it doesn't return any rows, I can see in the SQL query that it is appending the calls table to the fields

LTRIM(RTRIM(ISNULL(calls.call_topic_c,'')+N' '+ISNULL(calls.subtopic_c,''))) name

but they are in calls_cstm so the query is failing.  How can I make the concat use fields in the custom table?

LTRIM(RTRIM(ISNULL(calls_cstm.call_topic_c,'')+N' '+ISNULL(calls_cstm.subtopic_c,''))) name 


Using Sugar Ent 7.8