This action finds particular instances of a business object(s) in the system. There are several variations of the action:
FIND ALL Id()FIND ALL Account
FIND (Id() | StringLiteral())FIND 'Open accounts'
this action will run a query named ‘Open accounts’. Note that the apostrophe must only be used if the query name contains space symbols otherwise the identifier of the query name can be used without the apostrophe.
FIND Id() WHERE RuleCondition()FIND Account WHERE Account.State = 'Open'
The following constructs can be optionally used after the FIND action (written in any of the above formats):
ORDER BY AttributeIdentifier() (ASC | DESC)ASC keyword indicates the ascending order and the DESC keyword indicates the descending order. For example,FIND ALL Account ORDER BY Account.Balance
finds all accounts sorted by their balances in the ascending order. If ASC and DESC keywords are omitted the ASC keyword is implied.
TAKE BEST (IntegerLiteral() | AttributeIdentifier())FIND action, only the specified number of business object instances which match the specified criteria, will be found by the action. Typically this construct is used together with the ORDER BY keyword. For example,FIND ALL Account ORDER BY Account.Balance DESC TAKE BEST 5
this action will find 5 accounts with the highest balance.
FIND Account WHERE Account.State = 'OPEN' AND Account.Balance > 1000 ORDER BY Account.Balance IN BATCHES OF 5
Perform some actions with found objects (The actions will be performed in batches of 5 objects)
If IN BATCHES OF keyword is omitted the default batch size of 1000 is used. See also the “Batch Operations” section.
LIMIT ArithmeticExpression() , ArithmeticExpression()FIND action, only the specified rows will be returned. The first parameter indicates the first row number to be returned (starting from 1) and the second parameter indicates the number of rows to be returned. For example:FIND Account WHERE Account.State = 'OPEN' AND Account.Balance > 1000 LIMIT 20,3
This will return 3 rows starting from row 20.