I have given the following default value for a certain field ("treating_physician"):
<?php echo $CURRENT_USER['fullname'] . " " . $CURRENT_USER['firstname'] ; ?>
The type of field is a list field and the possible options in the list are taken from the following script:
SELECT CONCAT (fullname, " ", firstname)
FROM `<?php echo $TABLE_PREFIX ?>accounts`
WHERE hospital='<?php echo $CURRENT_USER['hospital'] ; ?>'
ORDER BY fullname
So far it works great. However, I just noticed that in the View mode of the record, there value on the field "Treating physician" is not shown although it does exist in the Edit mode.
On the contrary, if I choose the type of field as text field instead of list (using the same default value as shown before), the value of the "Treating physician" is shown in the View mode as well in the Edit mode.
As I want users to be able to choose only from a specific list of names the value for the treating_physician field, I wouldn't like to change the list type to the text field type.
I am not quite sure what I am doing wrong.