A new function has been added to the BO function handler that will help reducing the number of database queries.
The following scenario is very common in Logic Blocks and Methods:
IF bo.doesExist('someBO', 'someWhereClause') THEN
LOAD someBO BY some WhereClause
......
END IF
The following scenario is very common in Logic Blocks and Methods:
IF bo.doesExist('someBO', 'someWhereClause') THEN
LOAD someBO BY some WhereClause
......
END IF
- Check whether a rows exists (query 1)
- Load when it does exist (query 2)
The function bo.loadIfExist() is designed to replace the pattern above with a single statement:
IF bo.loadIfExist('someBO', 'someWhereClause', '*', 'bo') THEN
Done something with 'bo' in BO context
......
ELSE
Not found
END IF
IF bo.loadIfExist('someBO', 'someWhereClause', '*', 'bo') THEN
Done something with 'bo' in BO context
......
ELSE
Not found
END IF