ebs.getByQueryAsync

(FintechOS Studio 20.2 and later)

Asynchronously returns a promise of a collection of records based on a query (fetch object). If no filtering conditions are specified, all the entity data will be returned.

HINT  
For higher performance, use filtering conditions. This enables you to get only the data that is relevant to you.

Syntax

Copy
ebs.getByQueryAsync(fetchObj: IFetch): Promise<any>

Where the Fetch Object has the following syntax:

Copy
{
page: { //select a specific subset of the result set
    skip: number,
    take: number,
    returncount: boolean,
},
entity: {
    name: string,
    alias: string, //unique alias for the entity. Preceedes entity's attributes' names when referring to them
    attributelist: [{
            name: string,
            alias: string,
        }, {
            name: string,
            alias: string,
        }
    ],
    join: [{
            type: 'left''inner''right', // inner
            entity: {
                name: string,
                alias: string,
                attributelist: [{
                    name: string,
                }]
            },
            fromto: [{
                    from: string,
                    to: string,
                }, //join: ... // join from relatedEntity to another childrelatedEntity
            ]
        }, //add another join from masterEntity to another relatedEntity
    ]
},
orderby: [{ //criteria for ordering the result set
    type: 'asc''desc',
    attribute: name/alias,
}],
where: {
    type: 'or''and',
    expressionlist: [{
        type: 'and''or',
        conditionlist: [{
            type: 'contains''etc, posible functions',
            first: ,
            second: posible options,
        }, // add another condition
        ]
    }, // add another expression
    ]
},
options:{
    disableAutoLookupJoins: boolean //disables the auto joins added automatically for lookups and option sets (needed to retrieve the display names)
},
}
NOTE   If you want to join data from various entities and use it in form, views, filtered results, charts, etc, you need to:
 
 
Parameter Description
entity_name The parent entity, such as entity, attribute, relationship, systemuser, systemusertype, customizationset, businessunit, or portal.

entity_alias

Assigns a unique alias for the entity. This alias is used to precede the entity's attributes' names when referring to them.
filtering_criteria Criteria for filtering the result set.
paging_criteria Criteria for selecting a specific subset of the result set.
ordering_criteria Criteria for ordering the result set.
HINT   If you use the Fetch Designer when creating views, the output fetch object is generated automatically and you can copy-paste it into your code.

Response

If the promise is fulfilled, returns an array of JSON objects containing detailed information about each record in the result set. Otherwise, returns an empty array.

Examples