Ibm midrange AS/400上的GeneXus网格负载问题
我使用的是GeneXus X Evolution 3–版本10.3.98441 U5 我正在为AS/400平台编译RPG 我的挑战是,当我在工作面板中加载网格时,我需要筛选出具有特定状态值的记录。我终于让我的程序过滤掉不需要的记录,但现在它只显示最后一条有效记录。这是一个普遍的问题吗?或者某人以前遇到过的事情 这是我的工作面板中的事件代码Ibm midrange AS/400上的GeneXus网格负载问题,ibm-midrange,genexus,rpg,Ibm Midrange,Genexus,Rpg,我使用的是GeneXus X Evolution 3–版本10.3.98441 U5 我正在为AS/400平台编译RPG 我的挑战是,当我在工作面板中加载网格时,我需要筛选出具有特定状态值的记录。我终于让我的程序过滤掉不需要的记录,但现在它只显示最后一条有效记录。这是一个普遍的问题吗?或者某人以前遇到过的事情 这是我的工作面板中的事件代码 Event Load for each where RecordStatus = 'ACT' &nUserId = null
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和日期显示为字符字段。此块的目的是仅显示活动记录。项目要求使用软删除“删除”状态并仅显示活动记录
我对使用GeneXus、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
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
我在编辑中添加了网格加载代码,以查看这是否有帮助。没有。我一直在做一些测试来确定到底发生了什么。看起来我的网格中显示了一行,所有内容都覆盖了这一行。这些是文本记录,所以我只能看到最后一条记录的最后一行。我之前的例子都是一行,所以看起来像是最后一张唱片,但事实并非如此。