I created a custom field that displays the age of contacts. I added a php file to my vardefs having this code:
This conversation has been merged. Please reference the main conversation:
<?php//BEGIN CONTACTS VARDEFS
// adding age field
$dictionary['Contact']['fields']['age'] = array (
'name' => 'age',
'vname' => 'LBL_AGE',
'type' => 'datetime',
'function' => array('name'=>'getAge', 'returns'=>'html', 'include'=>'custom/CustomCode5.php'),
'len' => '6',
'comment' => 'What is the age of my contact'
//END CONTACTS VARDEFS
I then defined my function getAge in another php file and wrote some simple logic.
After doing build and repair, I went to studio and added the age field to detailview and listview.
After creating a contact, and checking detailview I could see a correct age number and results were good.
However in my listview, I could only see Age: with a dash under it and no value.
Please help me. I checked many threads, but none were helpful.