9 function custom_field_create_example() {
11 'custom_group_id' => 1,
12 'name' => 'test_date',
13 'label' => 'test_date',
14 'html_type' => 'Select Date',
15 'data_type' => 'Date',
16 'default_value' => '20071212',
24 require_once 'api/api.php';
25 $result = civicrm_api('custom_field', 'create', $params);
31 * Function returns array of result expected from previous function
33 function custom_field_create_expectedresult() {
35 $expectedResult = array(
43 'custom_group_id' => '1',
44 'name' => 'test_date',
45 'label' => 'test_date',
46 'data_type' => 'Date',
47 'html_type' => 'Select Date',
48 'default_value' => '20071212',
51 'is_search_range' => 0,
60 'options_per_line' => '',
62 'start_date_years' => '',
63 'end_date_years' => '',
68 'column_name' => 'test_date_1',
69 'option_group_id' => '',
74 return $expectedResult;
81 * This example has been generated from the API test suite. The test that created it is called
83 * You can see the outcome of the API tests at
84 * http://tests.dev.civicrm.org/trunk/results-api_v3
85 * and review the wiki at
86 * http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+Public+APIs
87 * Read more about testing here
88 * http://wiki.civicrm.org/confluence/display/CRM/Testing