SETSELECTIONFILTER not working correctly in 2015
rocatis
Member Posts: 163
I'm using build 38798.
Try importing these two pages and running page 91000:
The sub page returns correct counts, also when using Ctrl+A or clicking in the left corner of the list. The fact box, however, does not.
The question is if anybody has found a workaround or know of a working build.
Try importing these two pages and running page 91000:
OBJECT Page 91000 Main Page
{
OBJECT-PROPERTIES
{
Date=22-07-15;
Time=14:53:39;
Modified=Yes;
Version List=;
}
PROPERTIES
{
Editable=No;
SourceTable=Table2000000026;
SourceTableView=WHERE(Number=FILTER(1..5));
PageType=List;
ActionList=ACTIONS
{
{ 1160180004; ;ActionContainer;
ActionContainerType=ActionItems }
{ 1160180005;1 ;Action ;
Name=Count Sub Page as Group;
OnAction=VAR
integer@1160180000 : Record 2000000026;
BEGIN
CurrPage.SubPageAsGroup.PAGE.GetRecords(integer);
MESSAGE('Main Page Count: %1',integer.COUNT);
END;
}
{ 1160180009;1 ;Action ;
Name=Count Sub Page as FactBox;
OnAction=VAR
integer@1160180000 : Record 2000000026;
BEGIN
CurrPage.SubPageAsFactBox.PAGE.GetRecords(integer);
MESSAGE('Main Page Count: %1',integer.COUNT);
END;
}
}
}
CONTROLS
{
{ 1160180000;0;Container;
ContainerType=ContentArea }
{ 1160180001;1;Group ;
Name=Group;
GroupType=Repeater }
{ 1160180002;2;Field ;
SourceExpr=Number }
{ 1160180006;1;Group ;
GroupType=Group }
{ 1160180008;2;Part ;
Name=SubPageAsGroup;
PagePartID=Page91001;
PartType=Page }
{ 1160180007;0;Container;
ContainerType=FactBoxArea }
{ 1160180003;1;Part ;
Name=SubPageAsFactBox;
PagePartID=Page91001;
PartType=Page }
}
CODE
{
BEGIN
END.
}
}
OBJECT Page 91001 Sub Page
{
OBJECT-PROPERTIES
{
Date=22-07-15;
Time=14:47:09;
Modified=Yes;
Version List=;
}
PROPERTIES
{
Editable=No;
SourceTable=Table2000000026;
SourceTableView=WHERE(Number=FILTER(1..5));
PageType=ListPart;
OnAfterGetCurrRecord=BEGIN
// bug fix
// https://community.dynamics.com/nav/b/vikosnavblog/archive/2014/09/04/bug-in-nav-2013-r2-preventing-correct-execution-of-getrecord-setselectionfilter-and-it-39-s-workaround
END;
ActionList=ACTIONS
{
{ 1160180003; ;ActionContainer;
ActionContainerType=ActionItems }
{ 1160180004;1 ;Action ;
Name=Sub Page Count;
OnAction=VAR
integer@1160180000 : Record 2000000026;
BEGIN
GetRecords(integer);
END;
}
}
}
CONTROLS
{
{ 1160180000;0;Container;
ContainerType=ContentArea }
{ 1160180001;1;Group ;
Name=Group;
GroupType=Repeater }
{ 1160180002;2;Field ;
SourceExpr=Number }
}
CODE
{
PROCEDURE GetRecords@1160180000(VAR _integer@1160180000 : Record 2000000026);
BEGIN
CurrPage.SETSELECTIONFILTER(_integer);
MESSAGE('Sub Page Count: %1',_integer.COUNT);
END;
BEGIN
END.
}
}
What you will see are a main page and two sub pages which are actually the same page (91001). Only difference is that one is a sub page and the other is a fact box.The sub page returns correct counts, also when using Ctrl+A or clicking in the left corner of the list. The fact box, however, does not.
The question is if anybody has found a workaround or know of a working build.
Brian Rocatis
Senior NAV Developer
Elbek & Vejrup
Senior NAV Developer
Elbek & Vejrup
0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions