Problem with setselectionfilter and RunModal.

southindian
Member Posts: 247
I have a requirement in nav2013. In Sales order sub page(sub form) , add a new action button. When use clicks the action button, it should open a list page designed with ILE(3table 32). When he selects one or more that one records in the list page and click "OK" button in the list page. It should insert new lines in Sales Order Subpage, based on the selected records(MARKED ONLY) in List Page.
I have included following codes in Action Button of Sales order Subpage and in List Page, But not working
Action Button(Sales Order Sub Page)
ILE.reset;
ILE.setrange(entrytype,entrytype::Sales);
ILE.Setrange("Source No","Sell to customer No");
if Page.runbmodal(50123,ILE):= Action::Ok Then
List Page
Local Variable
ItemLedgerenty Record 32
ItemLedgerenty.copy(Rec);
currpage.setselectionfilter(ItemLedgerenty);
Iam able to get the marked record in list page by means of above code, but not able to carry that selected records to subpage.
Could any one help how to proceed with that.
I have included following codes in Action Button of Sales order Subpage and in List Page, But not working
Action Button(Sales Order Sub Page)
ILE.reset;
ILE.setrange(entrytype,entrytype::Sales);
ILE.Setrange("Source No","Sell to customer No");
if Page.runbmodal(50123,ILE):= Action::Ok Then
List Page
Local Variable
ItemLedgerenty Record 32
ItemLedgerenty.copy(Rec);
currpage.setselectionfilter(ItemLedgerenty);
Iam able to get the marked record in list page by means of above code, but not able to carry that selected records to subpage.
Could any one help how to proceed with that.
0
Comments
-
Try This Code
ILE.reset;
ILE.setrange(entrytype,entrytype::Sales);
ILE.Setrange("Source No","Sell to customer No");
if Page.runbmodal(50123,ILE):= Action::Ok Then
"Source No" := ILE."Source No"
Add Which Field you want to select and fill it to field.0 -
Hi southindian,
where in the page did you place the code you labeled "List Page" in your post, and most importantly, where and how do you call it?
You need to place it in a global function with ItemLedgerenty as a VAR parameter. The ItemLedgerenty.COPY line is superfluous. Such a function is typically named SetSelection in standard NAV.PROCEDURE SetSelection(VAR ItemLedgerEntry : Record 32); BEGIN CurrPage.SETSELECTIONFILTER(ItemLedgerEntry); END;
In the Sales Order subpage use a page variable:... ILEListPage.LOOKUPMODE(TRUE); ILEListPage.SETTABLEVIEW(ILE); IF ILEListPage.RUNMODAL = ACTION::LookupOK THEN BEGIN ILEListPage.SetSelection(ILE); IF ILE.FINDSET THEN REPEAT DoWhatever(ILE); UNTIL ILE.NEXT = 0; END;
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