From 0edb0491b08d2d6bad714a29d18d41353777e6ee Mon Sep 17 00:00:00 2001 From: Filip Hakansson Date: Wed, 26 Jun 2024 09:28:48 +0200 Subject: [PATCH] Updated DatabaseAPI documentation. Re: Reylan Reyes --- docs/documentation/api-specification/database-api.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/documentation/api-specification/database-api.md b/docs/documentation/api-specification/database-api.md index f765940..b69113a 100644 --- a/docs/documentation/api-specification/database-api.md +++ b/docs/documentation/api-specification/database-api.md @@ -99,7 +99,7 @@ void readRecord() { ### Read multiple records To read multiple records a database action should be defined along with a `Closure` that defines how each read record will be processed/used. -When reading multiple records, the 'readAll' function including 'pageSize' should be used. 'pageSize' is referred to as 'nrOfRecords' in the examples below. +When reading multiple records, the 'readAll' function including 'pageSize' should be used. 'pageSize' is referred to as 'nrOfRecords' in the examples below. Ten thousand records is the recommended maximum value of pageSize. Example: @@ -107,6 +107,7 @@ Read all items with status 20 in a specific company and perform an action on eac ```groovy void handleReleasedItems() { + int nrOfRecords = mi.getMaxRecords() <= 0 || mi.getMaxRecords() >= 10000? 10000: mi.getMaxRecords(); int currentCompany = (Integer)program.getLDAZD().CONO; DBAction query = database.table("MITMAS") .index("20") @@ -115,7 +116,7 @@ void handleReleasedItems() { DBContainer container = query.getContainer(); container.set("MMCONO", currentCompany); container.set("MMSTAT", "20"); - query.readAll(container, 2, releasedItemProcessor); + query.readAll(container, 2, nrOfRecords, releasedItemProcessor); } Closure releasedItemProcessor = { DBContainer container -> @@ -231,8 +232,7 @@ void deprecateItems() { container.set("MMCONO", currentCompany); container.set("MMSTAT", "20"); int nrOfKeys = 2; - int nrOfRecords = mi.getMaxRecords() <= 0 || mi.getMaxRecords() >= 10000? 10000: mi.getMaxRecords(); - query.readAllLock(container, nrOfKeys, nrOfRecords, updateCallBack); + query.readAllLock(container, nrOfKeys, updateCallBack); } Closure updateCallBack = { LockedResult lockedResult ->