Merge pull request #17170 from colemanw/optionValueDefault
[civicrm-core.git] / xml / schema / Core / CustomField.xml
CommitLineData
6a488035
TO
1<?xml version="1.0" encoding="iso-8859-1" ?>
2
3<table>
4 <base>CRM/Core</base>
5 <class>CustomField</class>
6 <name>civicrm_custom_field</name>
7 <comment>Stores info about an extended (custom) property (data and form field info).</comment>
8 <add>1.1</add>
9 <log>true</log>
10 <field>
186e0984
EM
11 <name>id</name>
12 <type>int unsigned</type>
56b7523d 13 <title>Custom Field ID</title>
186e0984
EM
14 <required>true</required>
15 <comment>Unique Custom Field ID</comment>
16 <add>1.1</add>
6a488035
TO
17 </field>
18 <primaryKey>
186e0984
EM
19 <name>id</name>
20 <autoincrement>true</autoincrement>
6a488035
TO
21 </primaryKey>
22 <field>
186e0984
EM
23 <name>custom_group_id</name>
24 <type>int unsigned</type>
56b7523d 25 <title>Custom Group</title>
186e0984
EM
26 <required>true</required>
27 <comment>FK to civicrm_custom_group.</comment>
28 <add>1.1</add>
29 <pseudoconstant>
30 <table>civicrm_custom_group</table>
31 <keyColumn>id</keyColumn>
32 <labelColumn>title</labelColumn>
33 </pseudoconstant>
34 <html>
35 <type>Select</type>
36 </html>
6a488035
TO
37 </field>
38 <foreignKey>
186e0984
EM
39 <name>custom_group_id</name>
40 <table>civicrm_custom_group</table>
41 <key>id</key>
42 <add>1.1</add>
43 <onDelete>CASCADE</onDelete>
6a488035
TO
44 </foreignKey>
45 <field>
186e0984
EM
46 <name>name</name>
47 <type>varchar</type>
56b7523d 48 <title>Custom Field Name</title>
186e0984
EM
49 <length>64</length>
50 <comment>Variable name/programmatic handle for this group.</comment>
51 <add>3.3</add>
6a488035
TO
52 </field>
53 <field>
186e0984
EM
54 <name>label</name>
55 <type>varchar</type>
56b7523d 56 <title>Custom Field Label</title>
186e0984
EM
57 <length>255</length>
58 <required>true</required>
59 <localizable>true</localizable>
60 <comment>Text for form field label (also friendly name for administering this custom property).</comment>
61 <add>1.1</add>
6a488035
TO
62 </field>
63 <field>
186e0984
EM
64 <name>data_type</name>
65 <type>varchar</type>
56b7523d 66 <title>Custom Field Data Type</title>
186e0984
EM
67 <length>16</length>
68 <required>true</required>
69 <comment>Controls location of data storage in extended_data table.</comment>
70 <pseudoconstant>
71 <callback>CRM_Core_BAO_CustomField::dataType</callback>
72 </pseudoconstant>
73 <add>1.1</add>
74 <html>
75 <type>Select</type>
76 </html>
6a488035
TO
77 </field>
78 <field>
186e0984
EM
79 <name>html_type</name>
80 <type>varchar</type>
4d1776fb 81 <title>Custom Field HTML Type</title>
186e0984
EM
82 <length>32</length>
83 <required>true</required>
84 <comment>HTML types plus several built-in extended types.</comment>
85 <pseudoconstant>
86 <callback>CRM_Core_SelectValues::customHtmlType</callback>
87 </pseudoconstant>
88 <add>1.1</add>
6a488035
TO
89 </field>
90 <field>
186e0984
EM
91 <name>default_value</name>
92 <type>varchar</type>
56b7523d 93 <title>Custom Field Default</title>
186e0984
EM
94 <length>255</length>
95 <comment>Use form_options.is_default for field_types which use options.</comment>
96 <add>1.1</add>
6a488035
TO
97 </field>
98 <field>
186e0984 99 <name>is_required</name>
56b7523d 100 <title>Custom Field Is Required?</title>
186e0984
EM
101 <type>boolean</type>
102 <comment>Is a value required for this property.</comment>
110f4343 103 <default>0</default>
186e0984 104 <add>1.1</add>
6a488035
TO
105 </field>
106 <field>
186e0984 107 <name>is_searchable</name>
56b7523d 108 <title>Allow Searching on Field?</title>
186e0984
EM
109 <type>boolean</type>
110 <comment>Is this property searchable.</comment>
110f4343 111 <default>0</default>
186e0984 112 <add>1.1</add>
6a488035
TO
113 </field>
114 <field>
186e0984
EM
115 <name>is_search_range</name>
116 <type>boolean</type>
56b7523d 117 <title>Search as a Range</title>
186e0984
EM
118 <comment>Is this property range searchable.</comment>
119 <add>1.4</add>
120 <default>0</default>
6a488035
TO
121 </field>
122 <field>
186e0984
EM
123 <name>weight</name>
124 <type>int</type>
7ecddde4 125 <title>Order</title>
186e0984
EM
126 <required>true</required>
127 <default>1</default>
128 <comment>Controls field display order within an extended property group.</comment>
129 <add>1.1</add>
6a488035
TO
130 </field>
131 <field>
186e0984
EM
132 <name>help_pre</name>
133 <type>text</type>
56b7523d 134 <title>Custom Field Pre Text</title>
186e0984
EM
135 <localizable>true</localizable>
136 <comment>Description and/or help text to display before this field.</comment>
137 <add>1.1</add>
6a488035
TO
138 </field>
139 <field>
186e0984
EM
140 <name>help_post</name>
141 <type>text</type>
56b7523d 142 <title>Custom Field Post Text</title>
186e0984
EM
143 <localizable>true</localizable>
144 <comment>Description and/or help text to display after this field.</comment>
145 <add>1.1</add>
6a488035
TO
146 </field>
147 <field>
186e0984
EM
148 <name>mask</name>
149 <type>varchar</type>
56b7523d 150 <title>Custom Field Formatting</title>
186e0984
EM
151 <length>64</length>
152 <comment>Optional format instructions for specific field types, like date types.</comment>
153 <add>1.1</add>
6a488035
TO
154 </field>
155 <field>
186e0984
EM
156 <name>attributes</name>
157 <type>varchar</type>
56b7523d 158 <title>Custom Field Attributes</title>
186e0984
EM
159 <length>255</length>
160 <comment>Store collection of type-appropriate attributes, e.g. textarea needs rows/cols attributes</comment>
161 <add>1.1</add>
6a488035
TO
162 </field>
163 <field>
186e0984
EM
164 <name>javascript</name>
165 <type>varchar</type>
56b7523d 166 <title>Custom Field Javascript</title>
186e0984
EM
167 <length>255</length>
168 <comment>Optional scripting attributes for field.</comment>
169 <add>1.1</add>
6a488035
TO
170 </field>
171 <field>
186e0984
EM
172 <name>is_active</name>
173 <type>boolean</type>
56b7523d 174 <title>Custom Field Is Active?</title>
186e0984 175 <comment>Is this property active?</comment>
110f4343 176 <default>1</default>
186e0984 177 <add>1.1</add>
6a488035
TO
178 </field>
179 <field>
186e0984
EM
180 <name>is_view</name>
181 <type>boolean</type>
56b7523d 182 <title>Field is Viewable</title>
110f4343 183 <default>0</default>
186e0984
EM
184 <comment>Is this property set by PHP Code? A code field is viewable but not editable</comment>
185 <add>1.1</add>
6a488035
TO
186 </field>
187 <field>
186e0984
EM
188 <name>options_per_line</name>
189 <type>int unsigned</type>
56b7523d 190 <title>Field Options Per Line</title>
186e0984 191 <comment>number of options per line for checkbox and radio</comment>
6a488035
TO
192 </field>
193 <field>
186e0984
EM
194 <name>text_length</name>
195 <type>int unsigned</type>
56b7523d 196 <title>Field Length</title>
186e0984
EM
197 <comment>field length if alphanumeric</comment>
198 <add>2.2</add>
6a488035
TO
199 </field>
200 <field>
186e0984
EM
201 <name>start_date_years</name>
202 <type>int</type>
56b7523d 203 <title>Field Start Date</title>
186e0984
EM
204 <comment>Date may be up to start_date_years years prior to the current date.</comment>
205 <add>1.4</add>
6a488035
TO
206 </field>
207 <field>
186e0984
EM
208 <name>end_date_years</name>
209 <type>int</type>
56b7523d 210 <title>Field End Date</title>
186e0984
EM
211 <comment>Date may be up to end_date_years years after the current date.</comment>
212 <add>1.4</add>
6a488035
TO
213 </field>
214 <field>
186e0984
EM
215 <name>date_parts</name>
216 <type>varchar</type>
217 <length>255</length>
218 <comment>which date part included in display </comment>
219 <add>1.4</add>
220 <drop>3.1</drop>
6a488035
TO
221 </field>
222 <field>
186e0984
EM
223 <name>date_format</name>
224 <type>varchar</type>
56b7523d 225 <title>Field Data Format</title>
186e0984
EM
226 <length>64</length>
227 <comment>date format for custom date</comment>
228 <add>3.1</add>
72c65bfa
CW
229 <pseudoconstant>
230 <callback>CRM_Core_SelectValues::getDatePluginInputFormats</callback>
231 </pseudoconstant>
6a488035
TO
232 </field>
233 <field>
186e0984
EM
234 <name>time_format</name>
235 <type>int unsigned</type>
56b7523d 236 <title>Field Time Format</title>
186e0984
EM
237 <comment>time format for custom date</comment>
238 <add>3.1</add>
72c65bfa
CW
239 <pseudoconstant>
240 <callback>CRM_Core_SelectValues::getTimeFormats</callback>
241 </pseudoconstant>
6a488035
TO
242 </field>
243 <field>
186e0984
EM
244 <name>note_columns</name>
245 <type>int unsigned</type>
56b7523d 246 <title>Field Note Columns</title>
72c65bfa 247 <comment>Number of columns in Note Field</comment>
186e0984 248 <add>1.4</add>
6a488035
TO
249 </field>
250 <field>
186e0984
EM
251 <name>note_rows</name>
252 <type>int unsigned</type>
56b7523d 253 <title>Field Note Rows</title>
72c65bfa 254 <comment>Number of rows in Note Field</comment>
186e0984 255 <add>1.4</add>
6a488035
TO
256 </field>
257 <field>
186e0984
EM
258 <name>column_name</name>
259 <type>varchar</type>
56b7523d 260 <title>Field Column Name</title>
186e0984
EM
261 <length>255</length>
262 <comment>Name of the column that holds the values for this field.</comment>
263 <add>2.0</add>
6a488035
TO
264 </field>
265 <field>
186e0984
EM
266 <name>option_group_id</name>
267 <type>int unsigned</type>
56b7523d 268 <title>Field Option Group</title>
186e0984
EM
269 <comment>For elements with options, the option group id that is used</comment>
270 <add>1.4</add>
5830940d
MM
271 <pseudoconstant>
272 <table>civicrm_option_group</table>
273 <keyColumn>id</keyColumn>
274 <labelColumn>title</labelColumn>
275 </pseudoconstant>
6a488035 276 </field>
2b216479
PN
277 <foreignKey>
278 <name>option_group_id</name>
279 <table>civicrm_option_group</table>
280 <key>id</key>
febf277f 281 <add>5.6</add>
2b216479
PN
282 <onDelete>SET NULL</onDelete>
283 </foreignKey>
6a488035 284 <field>
186e0984
EM
285 <name>filter</name>
286 <type>varchar</type>
56b7523d 287 <title>Field Filter</title>
186e0984
EM
288 <length>255</length>
289 <comment>Stores Contact Get API params contact reference custom fields. May be used for other filters in the future.</comment>
290 <add>4.1</add>
6a488035 291 </field>
5a205b89
PJ
292 <field>
293 <name>in_selector</name>
294 <type>boolean</type>
56b7523d 295 <title>Field Display</title>
5a205b89
PJ
296 <default>0</default>
297 <comment>Should the multi-record custom field values be displayed in tab table listing</comment>
298 <add>4.5</add>
299 </field>
6a488035
TO
300 <index>
301 <name>UI_label_custom_group_id</name>
302 <fieldName>label</fieldName>
303 <fieldName>custom_group_id</fieldName>
304 <unique>true</unique>
305 <add>1.1</add>
306 </index>
307 <index>
308 <name>UI_name_custom_group_id</name>
309 <fieldName>name</fieldName>
310 <fieldName>custom_group_id</fieldName>
311 <unique>true</unique>
312 <add>4.3</add>
313 </index>
314</table>