Access Leads Field Value into Calls Field

Hi everyone,

I need to display the value of Leads.lead_source into call module (list, details and edit view etc).

So i’ve created a custom text field “mir_leadsource_c” in Calls module with studio and try a solution that i’ve found in some threads here but i can’t get it work :-/

i’ve put this code in a new php file in /crm/custom/Extension/modules/Calls/Ext/Vardefs/ and Quick repair

    $dictionary['Call']['fields']['mir_leadsource_c'] = array (
	'name' => 'mir_leadsource_c',
	'id_name' => 'lead_id',
	'type' => 'relate',
	'rname' => 'lead_source',
	'vname' => 'TONTON',      
	'link' => 'leads',
	'module' => 'Leads',
	'source' => 'non-db',
	'dbType' => 'non-db',
	'studio' => 'visible',
	'massupdate' => false,

this results in my custom field mir_leadsource_c is displayed like the related_to field juste above and take me to select a lead …

I saw that I could also achieve the same result with a hook (before save and after retrieve) to get the lead_source of the linked lead to this call ) but I would like to understand how to make this first solution works

thank you very much for your help :slight_smile:

Hey there,

Are you still having issues with this?

It looks like those are relate-field vardefs, so it makes sense that you’d be seeing a relate field on calls!

You could make a simple text field through Admin->Studio, on the Calls Module
This might make life easier, as you can do it through the UI

Although, if you do indeed need to do it through code, I think the vardefs for a textfield would be closer to something like this:

$dictionary['Call']['fields']['mir_leadsource_c'] = array ( 
'name' => 'mir_leadsource_c',    
'vname' => 'TONTON',  
'dbType' => 'varchar',   
'type' => 'varchar',   
'len' => '50',   
'required' => false,  

Hi John,
Yes i still haven’t found how to achieve this simply.
A related field doesn’t seem to be what i want, like how to display the Lead’s “Address City” field value on a related Call form for this Lead. (i just need a readonly field)