Fields Array The fields array contains one array for each field in the SugarBean. At the top level of this array the key is the name of the field, and the value is an array of attributes about that field. The list of possible attributes are as follows: • 'name' = The name of the field • 'vname' = The language pack id for the label of this field • 'type' = The type of the attribute o 'relate' = Related Bean o 'datetime' = A date and time o 'bool' = A boolean value o 'enum' = An enumeration (drop down list from the language pack) o 'char' = A character array o 'assigned_user_name' = A linked user name • 'varchar' = A variable sized string • 'table' = The table this field comes from • 'isnull' = Is this field allowed to be set to null? • 'len' = The length of the field (number of characters if a string) • 'options' = The name of the enumeration in the language pack for this field • 'dbtype' = The database type of the field (if different than the type) • 'reportable' = Should this field show up in the list of fields for the reporting module (if applicable). • 'required' = true if this field is a required field • 'default' = The default value for this field • 'massupdate' = false if you do not want this field to show up in the mass update section at the bottom of the list views. Defaults to true. • 'rname' = (for type relate only) The field from the related variable that has the text • 'id_name' = (for type relate only) The field from the bean that stores the id for the related Bean • 'source' = 'nondb' if the field value does not come from the database. This can be used for calculated values or values retrieved in some other way. • 'sort_on' => The field to sort by if multiple fields are used. • 'fields' => (for concatenated values only) An array containing the fields that are concatenated. • 'db_concat_fields'=> (for concatenated values only) An array containing the fields to concatenate in the DB. The following example illustrates a standard ID field for a Bean. 'id' => array ( 'name' => 'id', 'vname' => 'LBL_ID', 'type' => 'id', 'required'=>true, ),
Copyright 2004-2008 SugarCRM Inc. Product License