How to preload with data a Sublevel Grid in Genexus?

304 Views Asked by At

I have one transaction with 2 levels, and i want to preload some data in the grid of the 2nd level when the user go into insert mode of the transaction.

1

There are 1 best solutions below

0
On

First of all the problem is if you to know or can predict the ID_Key of First Level, if so, you could call and process in the Event Start of TRN, that process made the dirty work.

In Transaction TrnX

Event Start
   **TrnXPreloadSubLevel**.Call(&ID_KEY)
   ...
   ...
EndEvent

In Process TrnXPreloadSubLevel

//-- rules 
Parm(&Id_Key);

//-- Source
    New //TrnXLvel2
       TrnXId      = &Id_Key
       TrnXIdLvl2  = 1
       ...
       ...
    EndNew //TrnXLvel2

    New //TrnXLvel2
       TrnXId      = &Id_Key
       TrnXIdLvl2  = 2
       ...
       ...
    EndNew //TrnXLvel2

    New //TrnXLvel2
       TrnXId      = &Id_Key
       TrnXIdLvl2  = 3
       ...
       ...
    EndNew //TrnXLvel2

And so on.

Warm Regards, gab