Business Object
JSON format to define application business objects
Business Objects are described as JSON files with well-known format, which defines the properties of each Business Object within the application. The format is called Business Object Definition
The Business Object Definition file is used by the compiler to generate Typescript declaration for your business object, which can be used directly in the application. It is also used to automatically create or upgrade the database schema, where the business object instances will be stored.
Each application may have as many as needed Business Object Definition files.
Every definition file must be located in src/Business Objects folder of the application.
It also must have the following format of the file name:
[BusinessObjectName].bo.json
So if your business object is called Customer, it must be stored in a json file called: Customer.bo.json If the business object is called Item, then it must be stored in a json file called: Item.bo.json
Take a look at the Business Object Definition file bellow. It is a JSON structure, which have one root property with the name of the Business Object ( line #3). Then it has a number of
1
{
2
//name of the business object
3
"Customer": {
4
5
//the name of the business object
6
//must be the same as the name of the business object
7
"name": "Customer",
8
9
//label of the business object displayed in UI widgets
10
// must be a string or translation identifier
11
"label": "Customer",
12
13
//plural label for the business object displated in UI widgets
14
"pluralLabel":"Customers",
15
16
//maximum number of objects displayed at once in UI widgets
17
//must be a number
18
"pageSize": 300,
19
20
//if the UI widgets will automatically expose searching UI
21
//cab be true or false
22
"searching": true,
23
24
//optional, defines the name of the business object when it
25
//is transmitted over the wire during synchronization scenarios.
26
//must be a string
27
"syncTag":"Customer"
28
29
//cotains list of business object members
30
"properties": {
31
//DMS_ROWID is required member and must be declared exaclty in this way
32
"DMS_ROWID": {
33
"type": "Binary",
34
"isIdentity": true,
35
"isPK": true,
36
"label": "Id",
37
"sorting": false,
38
"searching": false,
39
"uiType": "Default"
40
},
41
//custom business object member
42
"no": {
43
44
//required, data type of the business object
45
//String, Int32, Int64, Decimal, DateTime, Boolean, Binary
46
"type": "String",
47
48
//optional, max size of the data assigned to the member
49
//must be a number
50
"length": 30,
51
52
53
//optional, label of the member displayed in UI widgets. Can be a string
54
//or translation identifier
55
"label": "Name",
56
57
//optional, defines if the member is required on insert
58
//can be true or false
59
"required": true,
60
61
//optional, defines if the member can be sorted in UI widgets
62
//can be true or false
63
"sorting": true,
64
65
//optional, defines if the member can be searched in UI widgets
66
//can be true or false
67
"searching": true,
68
69
//optional, defines the user interface type used from UI widgets to
70
//render this member. Can be Default or textarea
71
"uiType": "Default",
72
73
//optional, defines the name of the attribute when the business object
74
//is transmitted over the wire during synchronization scenario.
75
//must be a string
76
"syncTag": "No"
77
},
78
"age": {
79
"type": "Int32",
80
"label": "Name",
81
"required": true,
82
"sorting": true,
83
"searching": true,
84
"uiType": "Default",
85
},
86
//add more members here separated with comas
87
88
}
89
}
90
}
Copied!

See Also

Last modified 1yr ago
Copy link
Contents
See Also