AS/400 上的 GeneXus 网格负载问题

GeneXus grid load issue on AS/400

我正在使用 GeneXus X Evolution 3 – 版本 10.3.98441 U5

我正在为 AS/400 平台编译 RPG。

我的挑战是,当我在工作面板中加载网格时,我需要过滤掉具有特定状态值的记录。我终于让我的程序过滤掉不需要的记录,但现在它只显示最后一条有效记录。这是个常见的问题吗?或者有人以前遇到过什么?

这是我的工作面板中的事件代码。

Event Load
for each 
    where RecordStatus = 'ACT'
        &nUserId = nullValue(&nUserId) // clear the note author variable
        &nDate   = nullValue(&nDate)   // clear the date the note was created
        if RecordNoteLine = 1 // only put printable values on the first line
            &nDate = DtoC(RecordDate)
            call(Prog0364, RecordWho, &nUserId) // get userID from emp no
        endif
        &noteUserId = &nUserId 
        &noteDate   = &nDate
        &noteText   = RecordNotes
        MyGrid.Load()
endfor
Endevent

将用户ID和日期置空的目的是在记录显示的第一行只显示用户ID和日期(作为字符字段)。此块的目的是仅显示活动记录。项目要求使用软删除('DEL'状态)并且只显示活动记录。

我对使用 GeneXus、RPG 和在任何大型机平台上进行开发还很陌生,因此非常感谢任何帮助。

通过一些 "playing around" 和测试各种结果,我得出了以下问题的(?)解决方案:

Event Load
for each 
    where RecordStatus = 'ACT'
        &nUserId = nullValue(&nUserId) // clear the note author variable
        &nDate   = nullValue(&nDate)   // clear the date the note was created
        if RecordNoteLine = 1 // only put printable values on the first line
            &nDate = DtoC(RecordDate)
            call(Prog0364, RecordWho, &nUserId) // get userID from emp no
        endif
        &noteUserId = &nUserId 
        &noteDate   = &nDate
        &noteText   = RecordNotes
        Load  // <--- THIS is key and obviously I misunderstood when told to use a "load"
              // I was ignorant of what that was, so I looked it up and found 
              // the original code that didn't work for me.
endfor
Endevent