5121 Posts in 1527 Topics by 1119 members
|Go to End|
17 October 2010 at 7:46pm
How can I display the ID assigned to the current DataObject in the admin. I've tried adding fields and making them readonly, but the fields never show up; something like:
$fields->addFieldToTab("Root.Content.Main", new TextField("ID", "Doctor ID"));
the field doesn't show up. Is there a way I can display that info in the admin?
19 October 2010 at 9:56pm
This will show the ID in the list of records and in the record view. I have found that using 'known' names for fields doesn't always work - so in this case I make sure that I am not using the name 'ID' instead 'MyID'.
public static $summary_fields = array (
'ID' => 'ID',
$fields = parent::getCMSFields();
(note assumes 'Name' in your $db fields!)
|Go to Top|