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