Modify an existing field definition
Content
Resource URL
https://apps.ticketmatic.com/api/1/{accountname}/settings/system/fielddefinitions/{id}
Example
Request
1use Ticketmatic\Endpoints\Settings\System\Fielddefinitions;
2
3$result = Fielddefinitions::update($client, $id, array(
4 "align" => "left",
5 "description" => "Created timestamp",
6 "key" => "createdtimestamp",
7 "sqlclause" => "tm.order.createdts",
8 "uitype" => "number",
9 "variablewidth" => true,
10 "width" => 50,
11));
Response
1object(\Ticketmatic\Model\FieldDefinition) (12) {
2 ["id"]=>
3 int(0)
4 ["typeid"]=>
5 int(0)
6 ["align"]=>
7 string(4) "left"
8 ["description"]=>
9 string(17) "Created timestamp"
10 ["key"]=>
11 string(16) "createdtimestamp"
12 ["sqlclause"]=>
13 string(18) "tm.order.createdts"
14 ["uitype"]=>
15 string(6) "number"
16 ["variablewidth"]=>
17 bool(true)
18 ["width"]=>
19 int(0)
20 ["isarchived"]=>
21 bool(false)
22 ["createdts"]=>
23 object(\DateTime) (3) {
24 ["date"]=>
25 string(26) "2014-09-26 15:24:36.000000"
26 ["timezone_type"]=>
27 int(3)
28 ["timezone"]=>
29 string(3) "UTC"
30 }
31 ["lastupdatets"]=>
32 object(\DateTime) (3) {
33 ["date"]=>
34 string(26) "2014-09-26 15:24:36.000000"
35 ["timezone_type"]=>
36 int(3)
37 ["timezone"]=>
38 string(3) "UTC"
39 }
40}
Request
1import (
2 "github.com/ticketmatic/tm-go/ticketmatic"
3 "github.com/ticketmatic/tm-go/ticketmatic/settings/system/fielddefinitions"
4)
5
6result, err := fielddefinitions.Update(client, id, &ticketmatic.FieldDefinition{
7 Align: "left",
8 Description: "Created timestamp",
9 Key: "createdtimestamp",
10 Sqlclause: "tm.order.createdts",
11 Uitype: "number",
12 Variablewidth: true,
13 Width: 50,
14})
Response
1result := &ticketmatic.FieldDefinition{
2 Id: 123,
3 Typeid: 10001,
4 Align: "left",
5 Description: "Created timestamp",
6 Key: "createdtimestamp",
7 Sqlclause: "tm.order.createdts",
8 Uitype: "number",
9 Variablewidth: true,
10 Width: 50,
11 Isarchived: false,
12 Createdts: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
13 Lastupdatets: ticketmatic.NewTime(ticketmatic.MustParseTime("2014-09-26 15:24:36")),
14}
Request
1PUT /api/1/{accountname}/settings/system/fielddefinitions/{id} HTTP/1.1
2Content-Type: application/json
3
4{
5 "align": "left",
6 "description": "Created timestamp",
7 "key": "createdtimestamp",
8 "sqlclause": "tm.order.createdts",
9 "uitype": "number",
10 "variablewidth": true,
11 "width": 50
12}
Response
1HTTP/1.1 200 OK
2Content-Type: application/json
3
4{
5 "id": 123,
6 "typeid": 10001,
7 "align": "left",
8 "description": "Created timestamp",
9 "key": "createdtimestamp",
10 "sqlclause": "tm.order.createdts",
11 "uitype": "number",
12 "variablewidth": true,
13 "width": 50,
14 "isarchived": false,
15 "createdts": "2014-09-26 15:24:36",
16 "lastupdatets": "2014-09-26 15:24:36"
17}
Request body fields
Field | Description |
---|---|
align string (required) | Alignment of the field definition, when used in a view. Values can be ‘left’, ‘right’ or ‘center’ Example value:"left" |
description mlstring (required) | Human-readable name for the field definition Example value:"Created timestamp" |
key string (required) | Key for the field definition. Should only consist of lowercase alphanumeric characters Example value:"createdtimestamp" |
sqlclause string (required) | The actual definition of the field definition. Contains the sql clause that will retrieve the information element in the database. Example value:"tm.order.createdts" |
uitype string (required) | Will decide how the field will be rendered when used in a view. Example value:"number" |
variablewidth bool (required) | Indicates whether the width for the field definition can be adapted when stretching a view that includes the field definition across the whole available width. Example value:true |
width int (required) | Width of the field definition, when used in a view Example value:50 |
Type reference: FieldDefinition
Result fields
Field | Description |
---|---|
id int | Unique ID Example value:123 |
typeid int | Type ID Example value:10001 |
align string | Alignment of the field definition, when used in a view. Values can be ‘left’, ‘right’ or ‘center’ Example value:"left" |
description | Human-readable name for the field definition Example value:"Created timestamp" |
key string | Key for the field definition. Should only consist of lowercase alphanumeric characters Example value:"createdtimestamp" |
sqlclause string | The actual definition of the field definition. Contains the sql clause that will retrieve the information element in the database. Example value:"tm.order.createdts" |
uitype string | Will decide how the field will be rendered when used in a view. Example value:"number" |
variablewidth bool | Indicates whether the width for the field definition can be adapted when stretching a view that includes the field definition across the whole available width. Example value:true |
width int | Width of the field definition, when used in a view Example value:50 |
isarchived bool | Whether or not this item is archived |
createdts timestamp | Created timestamp Example value:"2014-09-26 15:24:36" |
lastupdatets timestamp | Last updated timestamp Example value:"2014-09-26 15:24:36" |
Type reference: FieldDefinition