Register new Function

Beas script can be defined to executed, if you call the function.

Use this as small "Rest Service calls"

 

Call this with

get [entityname]/[functionname](parameter)

 

First define the function in the Object

[register collections]
CompanyWorkOrderActivity=primary=ClgCode/n<tab>description=Activity for Work order
[/register collections]
 

 

In Object defintion define with "Function" the new function

Follow Properties are available

Property

Description

name

Function name

description

Function description

parameter

Defines the parameter

 

 

Example

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

// Define function without Parameter
function=name=CountOfEntries<tab>description=Return count of existing activities
// Define function with parameter
function=name=AddValues<tab>description=Add 2 values<tab>parameter=value1/i,value2/i
function=name=ItemInfo<tab>description=Return Item Info<tab>parameter=e_itemcode/c
[/register CompanyWorkOrderActivity]

 

In the Area [object/FunctionName] you can define the function

BeasScript: All Parameters defined as String Variables. All return values are string variables.

 

Follow variables you can define for the return

Variable

Description

result

sql (only beas script)

sqljson

code

Return the code (the default is 200 = ok. . If this is modified, it results in an error.

messagecode / message

Define the error code and error message, if the code is not 200

Note: The system display message only, if you end the function with

return failure