BeasScript 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 definition create the new function with "Function".
The following Properties are available:
Property |
Description |
|
---|---|---|
name |
Function name |
|
description |
Function description |
|
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.
The following variables can be defined for the return
Variable |
Description |
|
---|---|---|
result |
|
|
sql (only BeasScript) 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 displays message only if you end the function with return failure |