Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Previously the following code:

Code Block
languagec#
 oQuery = NEW CustomerQuery() .
 
oQuery:Or (NEW CustomerQuery ():Country:Eq("USA"):And:City:Begins("Bost"),
           NEW CustomerQuery ():Country:Eq("DE"):And:City:Begins("Colog"))
       :And:CreditLimit:Lt(1000).
 
MESSAGE oQuery:ToQueryString(false)
    VIEW-AS ALERT-BOX.



was resulting in this query string:

No Format
for each eCustomer where Country EQ "USA" AND City BEGINS "Bost" OR (Country EQ "DE" AND City BEGINS "Colog") AND CreditLimit LT 1000

...

Implemented a new property Batching on the TableModel class

Code Block
languagec#
oCustomer = NEW CustomerDatasetModel () .
oCustomer:BatchSize = 5 .
oCustomer:Customer:Batching = FALSE .
oCustomer:Customer:Filter:CustNum:LT(100):Run () .



When the Batching property is set to FALSE, the DatasetModel/TableModel will only provide access to the number of records specified by the BatchSize property.

The property can also be set using a fluent interface - when the TableModelGenerated has been generated using the most recent templates:

Code Block
languagec#
oCustomer = NEW CustomerDatasetModel () .
oCustomer:SetBatchSize(5):Customer:SetBatching (FALSE):Filter:CustNum:LT(100):Run () .

...

The new general purpose class Consultingwerk.OERA.GenericFetchDataByKeyTableParameter can be used as the parameter to the FetchDataByKeyTable method of the Business Entity and Data Access class.

Code Block
languagec#
DEFINE VARIABLE oKeys AS GenericFetchDataByKeyTableParameter NO-UNDO .
DEFINE VARIABLE hRecord AS HANDLE NO-UNDO.

/* Create parameter object, providing value for the Tables property to the constructor */
oKeys = NEW GenericFetchDataByKeyTableParameter ("eOrderLine":U) .

/* Define the key fields */
oKeys:CreateField ("Ordernum", DataTypeEnum:INTEGER) .
oKeys:CreateField ("Linenum",  DataTypeEnum:INTEGER) .

/* Create records in the key table */
hRecord = oKeys:CreateRecord() .
hRecord::OrderNum = 1 .
hRecord::LineNum = 1 .

hRecord = oKeys:CreateRecord() .
hRecord::OrderNum = 1 .
hRecord::LineNum = 2 .

hRecord = oKeys:CreateRecord() .
hRecord::OrderNum = 1 .
hRecord::LineNum = 3 .

/* Invoke the method FetchDataByKeyTable */ 
ServiceInterface:InvokeMethod ("Consultingwerk.OeraTests.SCL647.OrderLineBusinessEntity",
                               "FetchDataByKeyTable":U,
                               INPUT-OUTPUT DATASET dsOrderLine, 
                               oKeys) .

...