Programatically selecting multiple records in list-page

Chris2402
Member Posts: 2
Is there a way to select multiple records in a listpage, programatically with C/AL?
I know I can select a single record with Rec.Mark - but im in need to select a range of consecutive records.
Thnx
I know I can select a single record with Rec.Mark - but im in need to select a range of consecutive records.
Thnx
0
Answers
-
Try something like this, call the function GetSelectionFilter after the user mark the fields
OBJECT Page 70003 xxxx { OBJECT-PROPERTIES { Date=17-05-29; Time=11:02:17; Modified=Yes; Version List=#STB01#; } PROPERTIES { SourceTable=Table27; PageType=List; OnOpenPage=BEGIN CLEARMARKS; END; OnAfterGetRecord=BEGIN Marked := MARK; END; } CONTROLS { { 1000000000;0;Container; ContainerType=ContentArea } { 1000000001;1;Group ; Name=Group; GroupType=Repeater } { 1000000005;2;Field ; SourceExpr=Marked; OnValidate=BEGIN IF Marked THEN MARK(TRUE) ELSE MARK(FALSE); END; } { 1000000002;2;Field ; SourceExpr="No." } { 1000000003;2;Field ; SourceExpr=Description } { 1000000004;2;Field ; SourceExpr="Assembly BOM" } } CODE { VAR Marked@1000000000 : Boolean; PROCEDURE GetSelectionFilter@1000000000(VAR Item@1000000000 : Record 27); BEGIN MARKEDONLY(TRUE); IF FINDSET THEN Item.COPY(Rec); END; BEGIN END. } }
0 -
Depending on what exactly try to do, you can just use
CurrPage.SETSELECTIONFILTER(Recordvar)
You can multiselect in any list page, SETSELECTIONFILTER returns the marked records to "RecordVar"
Hope this helps.0
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