Every object can have own columns
This is the same as in SQL the fields
In BSL you create the bridge between ODATA and SQL Server. A field can be a SQL Field, SQL Formula or SubSelect command.
In this example we add columns to the created object "CompanyWorkOrderActivity"
[register collections]
CompanyWorkOrderActivity=primary=ClgCode<tab>description=Activity for Work order
[/register collections]
Columns defined in
// Define all Columns, Functions, Table and other properties
[register CompanyWorkOrderActivity]
table=OCLG
post=true
column=name=ActivityCode<tab>sql="OCLG"."ClgCode"<tab>fieldtype=i
column=name=Details<tab>sql="OCLG"."Details"<tab>maxlength=20<tab>fieldtype=c
[/register CompanyWorkOrderActivity]
Add a column with the following properties:
Note: All properties are mandatory.
Property |
Description |
---|---|
name |
The name of object. Only A-Z, a-z, 0-9 and underline are allowed. Do not use any other character. This property is mandatory. |
sql |
The SQL statement (field name) from table This SQL statement must return a value from type String, DateTime or Number. Other types not supported If you need Boolean, the field must return 1 for true or 0 for false |
fieldtype |
The field type c=char i=integer/numeric d=date b=boolean default=c
Note: You must define the same type as the SQL field return boolean: Beas supports only number: 1 for true, 0 for false date: The database must return a datetime field char: Can be char, nchar, text or ntext. Max. length 16kByte |
maxlength |
For type c: the max. length default=20 |
description |
The description of this object |