I'm trying to use Smarty PHP for custom functionality in the ListView (custom/modules/Leads/metadata/listviewdefs.php) of SugarCRM (6.5.3).
This works fine:
'customCode' => '{$LD_ASSUMED_SUGAR_ACCOUNT_ID_C}',
And so does this:
'customCode' => '{$ACCOUNT_NAME}',
However this just outputs the code (brackets and all) in the List (but with Account name substituted for the correct value):
'customCode' => '{if $LD_ASSUMED_SUGAR_ACCOUNT_ID_C}{$ACCOUNT_NAME}{/if}',
What am I doing wrong!?
I don't think you can achieve the same result you are looking for in ListView like you can in EditView & DetailView. One way to go about this is to add a non-db field to Leads vardefs and use a logic hook to handle conditional formatting.
Create a new vardef:
/custom/Extension/modules/Cases/Ext/Vardefs/my_listview_value_c.php
Create the logic hook:
/custom/modules/Leads/ListViewLogicHook.php
Add the logic hook entry:
Finally, in your listviewdefs add the new column:
Hope that helps.