How to check multiple checkboxes on a page based on conditions

Hello everyone,

I'm having trouble with a feature I'm trying to implement:

I have this "Data Page" that shows Customers and their respective invoices below them:

prqsrr4mvak7.png

So I'm trying to click on the checkbox from the line where "Type = Customer" (Marked red)
and the lines where "Type = GL Account" should get checked (marked Blue).

I have tried this so far on the page trigger:

Approved - OnValidate()

rec_data.SETRANGE("Account Reference",Rec.Account);
IF rec_data.FINDSET THEN BEGIN
REPEAT
//MESSAGE('%1',rec_data.Account);
Approved := TRUE;
UNTIL rec_data.NEXT = 0;
END;
/.../

rec_data is a Record variable with the information.
"Account Reference" is a field which contains the Customer No. so that each Invoice knows who it belongs to.
The line "MESSAGE('%1',rec_data.Account);" correctly displays all of the invoice's numbers that are under the selected Customer but the "Approved := TRUE" does not work.

I'm out of ideas, also I don´t know if this is the correct way.

Please help me, thanks in advance.
Cristiano Ferro.

Best Answer

Answers

  • FerroFerro Member Posts: 7
    Yes I was missing MODIFY along with CurrPage.Update and some logic using SetSelectionFilter.
    Thanks a lot
  • jbeckerjbecker Member Posts: 5
    Hi,
    I'm writing in this thread because I have a very similar task to Ferro's one..
    But in my case 'Approved' would be a global variable.

    So to be more precise I have a page based on Table 9000 'User Group' and I want to click on the checkbox in the first row where Code = TEST_0 and then the both other lines should get checked too.

    sttoz43gj7na.png


    But in my case 'add' is global variable and not a field.

    So here is what I tried

    add - OnValidate()
    IF Code = 'TEST_0' THEN
    BEGIN
    Rec.SETFILTER(Code,'TEST_1*');
    IF Rec.FINDSET THEN BEGIN
    REPEAT
    add := TRUE;
    UNTIL Rec.NEXT = 0
    END;
    Rec.RESET;
    END;

    But that didn*t work out, it seems only to check one of the both lines

    nt90cgi1t2eg.png

    and when I click on 'Refresh' suddenly all lines in the page are checked.

    6gsndu4lhto6.png

    Would be great if someone had an idea how to solve this problem.

    Thank you.
  • rxqrxqrxq_zydrxqrxqrxq_zyd Member Posts: 19
    you can use some select filter, nav provide this function: CurrForm.SETSELECTIONFILTER ,which will show the selected records from users
Sign In or Register to comment.