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:
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.
Answers
Thanks a lot
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.
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
and when I click on 'Refresh' suddenly all lines in the page are checked.
Would be great if someone had an idea how to solve this problem.
Thank you.