0

I am using GeneXus X Evolution 3 – Version 10.3.98441 U5

I am compiling RPG for AS/400 platform.

My challenge is that I need to filter out records with a certain status value when I load a grid in a work panel. I’ve finally gotten my program to filter out unwanted records, but now it is only displaying the last valid record. Is this a common problem? Or something someone has encountered before?

Here is the event code from my work panel.

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

The purpose of nulling the user ID and date is to only display the user ID and date(as a character field) on the first line of the record display. The purpose of this block is to only display active records. It is a requirement of the project to use a soft delete ('DEL' status) and only display active records.

I am very new to using GeneXus, RPG, and developing on any mainframe platform, so any help would be greatly appreciated.

CoMo G-Dawg
  • 401
  • 1
  • 3
  • 18
  • I have added the grid load code (in edits) to see if that helped. it did not. – CoMo G-Dawg May 31 '18 at 14:51
  • I've been doing some testing on this to determine exactly what is happening. It appears that I've got ONE LINE showing up in my grid and everything overwrites that one line. These are text records, so all I can see is the last line of the last record. My previous examples were all one line long, so it looked like the last record but that wasn't the case. – CoMo G-Dawg May 31 '18 at 19:41

1 Answers1

1

Through a bit of "playing around" and testing various outcomes, I arrived at the following for a (the?) solution to my problem:

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
CoMo G-Dawg
  • 401
  • 1
  • 3
  • 18