我正在使用GeneXus X演进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
¬eUserId = &nUserId
¬eDate = &nDate
¬eText = RecordNotes
MyGrid.Load()
endfor
Endevent
将用户ID和日期设为空的目的是仅在记录显示的第一行显示用户ID和日期(作为字符字段)。此块的用途是仅显示活动记录。项目要求使用软删除('DEL‘状态),并且只显示活动记录。
我对使用GeneXus、RPG和在任何大型机平台上进行开发都是非常陌生的,所以任何帮助都将不胜感激。
发布于 2018-06-01 04:22:45
通过一些“玩弄”和测试各种结果,我得出了以下结论( the ?)我的问题的解决方案:
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
¬eUserId = &nUserId
¬eDate = &nDate
¬eText = 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
https://stackoverflow.com/questions/50626556
复制相似问题