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

时间:2018-05-31 14:21:12

标签: ibm-midrange genexus rpg

我正在使用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和开发,所以非常感谢任何帮助。

1 个答案:

答案 0 :(得分:1)

通过一些“玩弄”并测试各种结果,我得到了以下问题的解决方案:

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