I have been wondering how to change the account name in detail view of leads [in Sugar CRM] to a link when a lead has been converted to an account or atleast when the lead has an account_id. A forum i have been following [will post the link later] told me to change the /cache/module/Leads/DetailView.tpl and edit the line that displays the account name. But this would be reverted back everytime i redeploy the Leads Module. So its not really making sense to edit the cache files right?

I just found a way out today and it would be super useful to me in the future if i take this down. I have to edit the /custom/modules/Leads/metadata/detailviewdefs.php and add a custom code on the array that displays the account name.

'customCode' => '{if $fields.account_id}<a href="index.php?module=Accounts&action=DetailView&record={$fields.account_id.value}"><b>{$fields.account_name.value}</b></a>{else if}{$fields.account_name.value} {/if}',

This would take effect when you cleared the contents of /cache/modules/Leads 🙂 as the system would generate the new cache files.

I think that’s just it 🙂 when i want to do something in the detail view, i just have to edit the custom counterpart and delete the associated cache files 🙂