Register new Object

An Object presents an SQL Table. The Beas Service Layer is always only a bridge between ODATA and the SQL Server.

The table name is mandatory. For every Object you can add function calls or POST commands.

 

In Area [register collections] you can add own objects.

 

In this area, you can define the collection / object  with property: primary-key, description,key-mandatory

 
Example:
SAP Activity for work order call. We use the SAP Activity:

[register collections]

CompanyWorkOrderActivity=primary=ActivityCode/i<tab>description=Activity for Work order

[/register collections]

 

Property

Description

Name

On first place you define the name of the object.

Note: The name must be unique.

primary

Define the primary key (the object field name, not the sql field name) / Field Type (c for char or i for integer/number)

In case of more than one field, define fieldname, fieldname, example: DocEntry/i,LineNumber/i or ItemCode/c

description

Description for this object name

keymandatory

Mandatory key fields.
Example: In the warehouse object the warehouse ID is mandatory.
Normally, this does not need to be defined.

 

All additional details described in the same name area:

// 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

function=name=CountOfEntries<tab>description=Return count of existing activities

[/register CompanyWorkOrderActivity]

 

 

This returns the following result:

GET CompanyWorkOrderActivity
{
    "value": [
        {   "ActivityCode": 467,
            "Details": "item changed: 2-uom-test2 from manager"
        }, // and all other entries...
   ]
}

 

You can use the object with $select, $filter, $order and all other existing BSL functions.

Note: Always insert the company as suffix, otherwise naming conflicts can occur.

 

The following properties are available:

Property

Description

table={tablename}

Define the table related to this object. This is mandatory.

Example OCLG

post=true/false

Define if the

POST

command is possible.

If you define this as true you must define an area:

[objectname/post]

mainfilter=[sql filter]

You can define a main filter which is always active if you execute a GET command.

aliasname

You can define an alias name for the SQL statement. Use this, if you work with join and you need a table more than once.

column

Add a column / property to the Object

function

Add a function with the following properties.

mainfilter

join

filter_[xxx]

Define filter if property xxx is defined.

Supported properties: docentry, linenumber, linenumber2, docentry, personnelid, whscode

filterbranch

Define filter for using $branch

filtertransaction

Define filter for using $transaction

fitertransaction[xxx]

joincollection