SET-CALLBACK method with BEFORE-ROW-FILL example

Posted by Andrzej_Sz on 19-Sep-2016 15:16

Could somebody help me with creating SET-CALLBACK method with BEFORE-ROW-FILL callback to skip some records in DATASET temp-table ?

Regards

Andrzej

All Replies

Posted by Mike Fechner on 19-Sep-2016 15:26

Are you having problems with the SET-CALLBACK of the buffer? Or are you just seeking for how to skip records?
 
For the first, please post your code and error. Methods need to be PUBLIC L
 
For the second, it’s RETURN NO-APPLY . that skips a record.
Von: Andrzej_Sz [mailto:bounce-Andrzej_Sz@community.progress.com]
Gesendet: Montag, 19. September 2016 22:18
An: TU.OE.General@community.progress.com
Betreff: [Technical Users - OE General] SET-CALLBACK method with BEFORE-ROW-FILL example
 
Update from Progress Community
 

Could somebody help me with creating SET-CALLBACK method with BEFORE-ROW-FILL callback to skip some records in DATASET temp-table ?

Regards

Andrzej

View online

 

You received this notification because you subscribed to the forum.  To stop receiving updates from only this thread, go here.

Flag this post as spam/abuse.

 

Posted by Andrzej_Sz on 20-Sep-2016 01:46

I'm seeking how to skip records. For example: sports database, dataset - customers and orders; how to skip orders with more then 5 orderlines ?

Posted by Mike Fechner on 20-Sep-2016 01:52

Then in the eCustomerBeforeRowFill callback (the BEFORE-ROW-FILL callback for the eCustomer buffer) count the number of orders in the DB and RETURN NO-APPLY from customers that have >= 5 orders.
Von: Andrzej_Sz [mailto:bounce-Andrzej_Sz@community.progress.com]
Gesendet: Dienstag, 20. September 2016 08:48
An: TU.OE.General@community.progress.com
Betreff: RE: [Technical Users - OE General] SET-CALLBACK method with BEFORE-ROW-FILL example
 
Update from Progress Community
 

I'm seeking how to skip records. For example: sports database, dataset - customers and orders; how to skip orders with more then 5 orderlines ?

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

 

Posted by Andrzej_Sz on 20-Sep-2016 02:36

And how to reference to actual customer record field value ?

Posted by Mike Fechner on 20-Sep-2016 03:32

The DB record is accessible in the BEFORE-ROW-FILL call back.
 
So just, Customer.CustNum.
Von: Andrzej_Sz [mailto:bounce-Andrzej_Sz@community.progress.com]
Gesendet: Dienstag, 20. September 2016 09:38
An: TU.OE.General@community.progress.com
Betreff: RE: [Technical Users - OE General] SET-CALLBACK method with BEFORE-ROW-FILL example
 
Update from Progress Community
 

And how to reference to actual customer record field value ?

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

 

Posted by Andrzej_Sz on 20-Sep-2016 04:17

And is it necessary to precede imported record buffer with dataset handle (in CALLBACK definition and CALLBACK method) ?

DATASET dsCustomer:GET-BUFFER-HANDLE("ttOrder"):SET-CALLBACK("BEFORE-ROW-FILL", "preOrderFill").

...

METHOD PUBLIC VOID preOrderFill (INPUT DATASET dsCustomer):

 customerNumber = DATASET dsCustomer:GET-BUFFER-HANDLE("ttOrder"):BUFFER-FIELD("CustNum"):BUFFER-VALUE().

 IF customerNumber > 100 THEN RETURN NO-APPLY.

METHOD END.

Posted by Mike Fechner on 20-Sep-2016 06:27

No - as it's the BEFORE-ROW-FILL callback, the temp-table row is not yet there. That's why I wrote earlier, you access the CustNum value on the DB record, which is in scope (without any explicit find).

Posted by Andrzej_Sz on 21-Sep-2016 07:14

Thank you Mike for your assitance. My REST class works now. And by the way ... Could you give few examples of using AFTER-ROW-FILL callback. How to reference temp-table row, just ttorder ? Can I modify Dataset in that method ?

Posted by Mike Fechner on 21-Sep-2016 07:20

The Temp-Table record will just still be available in the AFTER-ROW-FILL. Just like the DB-Record is just available in the BEFORE-ROW-FILL.
Von: Andrzej_Sz [mailto:bounce-Andrzej_Sz@community.progress.com]
Gesendet: Mittwoch, 21. September 2016 14:16
An: TU.OE.General@community.progress.com
Betreff: RE: [Technical Users - OE General] SET-CALLBACK method with BEFORE-ROW-FILL example
 
Update from Progress Community
 

Thank you Mike for your assitance. My REST class works now. And by the way ... Could you give few examples of using AFTER-ROW-FILL callback. How to reference temp-table row, just ttorder ? Can I modify Dataset in that method ?

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

 

This thread is closed