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