Business Object API
Lowgile compiles each Business Object into code you can call from app code. This section lists, per Business Object type, the functions and properties that code can use.
How to reach a Business Object
Section titled “How to reach a Business Object”Every Business Object belongs to a Module and is reached through that Module’s namespace. Inside a Module, This refers to the Module itself, so This.Order and <ModuleName>.Order are the same object. This reference always writes This..
Some Business Object types are reached directly by name. Others are grouped under a $-prefixed namespace, and for those This.<Name> does not work:
| Business Object type | How to reach it | Availability |
|---|---|---|
| Entity | This.<EntityName> | Everywhere |
| Static Entity | This.<StaticEntityName> | Everywhere |
| Server Data Store | This.<ServerDataStoreName> | Both¹ |
| Client Data Store | app.<storeName>, not This. | Client |
| Label | This.$T.<LabelName> or This.$T_<LanguageId>.<LabelName> | Everywhere |
| Screen | This.$Screens.<ScreenName> | Everywhere |
| Process | This.$Process.<ProcessName> | Both¹ |
| Trigger | This.$Trigger.<TriggerName> | Server |
| Resource | This.$Resources.<ResourceName> | Everywhere |
| User-Defined Configuration | This.<ConfigurationName> | Both¹ |
| Report | This.<ReportName> | Both¹ |
| Service Integration | This.<ServiceIntegrationName> | Server |
| Service Provider | This.<ServiceProviderName> | Server |
| Configuration Item | This.$Config.<ItemName> | Everywhere |
| Role | This.$Roles.<RoleName> | Everywhere |
| Permission | This.$Permissions.<PermissionName> | Everywhere |
| Data Type | This.<DataTypeName>, as a type only | Everywhere |
| Theme, Language, Access Control | Nothing to call | — |
¹ On the client, the call is sent to the server, which checks the caller’s access first. For Server Data Stores and Processes, that check is Access Control; each page says which check applies.
Availability
Section titled “Availability”Each entry in this reference states where you can call it:
| Availability | Where you can call it |
|---|---|
| Server | Server-side code only: server methods, Process scripts, Triggers, Service Providers. |
| Client | Client-side code only: Screen code and client methods. |
| Both | Server-side and client-side code, but not shared code. |
| Both¹ | Server-side and client-side code. On the client, the call is sent to the server, so it is slower and the server checks the caller’s access first. |
| Everywhere | Server-side, client-side and shared code. Shared code is code Lowgile compiles for both sides, such as Entity methods with availability serverAndClient or calculation. |
Calls from the client go through Access Control
Section titled “Calls from the client go through Access Control”Many client-side functions, such as loading or saving through a Server Data Store or starting a Process, run on the server. The client sends the request, and the server refuses it unless an Access Control covering the Business Object grants it. Calls from server-side code are allowed unless an Access Control restricts them.
Note
Entities have no save, load or delete methods of their own. To persist an Entity, call the Server Data Store that stores it, for example This.MyDataStore.saveOne(order).
Related
Section titled “Related”- Sys API
- Object Types
-
Understanding
Thisandthisin Lowgile