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