OK, I got it working, but I'm not sure what changed.
At first it behaved exactly as you described with the field value not getting filled in. Specifically, I put a raw URL page, then attempted to fill in the field value and it took the URL, but did not fill in any field value.
Then I played with several things and it worked great, but I don't know exactly what changed.
Here is the php code that defines a panel with two different ways of defining the link taken directly from custom/modules/Accounts/metadata/detailviewdefs.php. I copied the definition for an entire new panel where I put two test links, thus the PANEL 2 label and the array with 0 and 1. Both links work with this code:
PHP Code:
'PANEL 2' =>
array (
0 =>
array (
0 =>
array (
'name' => 'ut_number_c',
'label' => 'LBL_UT_NUMBER',
'customCode' => '<a href="http://HOSTNAME/UTOrgAdd.asp?number={$fields.ut_number_c.value}" target="_blank">{$fields.ut_number_c.value}</a>',
),
1 =>
array (
'name' => 'ut_link_c',
'label' => 'LBL_UT_LINK',
'customCode' => '<a href="{$fields.ut_link_c.value}" target="_blank">UT Link</a>',
),
),
WARNING: Using SugarCRM Admin panel to edit Layouts blows away the customized line defining the link -- at least if you move the link field.
Also note that I had to clear the cache from the admin panel before any changes would take effect.
Phil
Bookmarks