How to check multiple checkboxes on a page based on conditions

Ferro
Member Posts: 9
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.
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.
0
Best Answer
-
Is approved a field or a global variable? If it is a field you forgot the modify5
Answers
-
Is approved a field or a global variable? If it is a field you forgot the modify5
-
Yes I was missing MODIFY along with CurrPage.Update and some logic using SetSelectionFilter.
Thanks a lot0 -
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.
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.0 -
you can use some select filter, nav provide this function: CurrForm.SETSELECTIONFILTER ,which will show the selected records from users0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions