How to get filters from page
IvonaK
Member Posts: 115
Is there any function in Nav 2009 R2 where I can get filters from page.
Thank a lot,
Thank a lot,
0
Comments
-
Hi,
I have a page like picture 1 and I want when insert new item in Table to get filter Type to be: Subgroup1 and Parent Code to be 500 (filters are marked with red ).
Thanks,0 -
SETRANGE(Type,Type::Subgroup1); SETRANGE("Parent Code",500);
To be added in OnInsertRecord trigger (or OnNewRecord, depending from your requirements details).* Daniele Rebussi * | * Rebu NAV Diary *0 -
on the page:
use Rec.GETFILTERS to see if any filters are set
use Rec.GETFILTER(Type) to get the value that the record is currently filtered for. e.g. type::Subgroup1
you can use it like this:
otherinstanceofRec.init;
otherinstanceofRec.type := rec.getfilter(type);
otherinstanceofRec.insert;
BUT: it's not guaranteed that the falue you get from "getfilter" is an actually valid value for the field... e.g. if the fitler is set to Type::subgroup1..Type::subgroup6 you will get an error.0 -
Take a look at the FILTERGROUP function.
The page might be using FILTERGROUP 2, 3 or 4.
the use
FILTERGROUP(4);
GETFILTER(Type);
FILTERGROUP(0);
Take a look here http://msdn.microsoft.com/en-us/library/dd338919.aspx________________________________
Gunnar Gestsson
Microsoft Certified IT Professional
Dynamics NAV MVP
http://www.dynamics.is
http://Objects4NAV.com0 -
I have a table "Item Organizational Group", which has been done something like tree (picture 1)
I have set LookUpFormId on table propertis
On the table:Item I have add new field: Main Group, Subgroup 1, Subgroup 2 in which:
Main Group: Table Relation: "Item Organizational Group" WHERE (Type = FILTER (Main Group))
Subgroup 1: Table Relation: "Item Organizational Group" WHERE (Type = FILTER (Subgroup 1), Parent Code = FIELD (Main Group))
Subgroup 2: Table Relation: "Item Organizational Group" WHERE (Type=FILTER(Subgroup 2),Parent Code=FIELD(Subgroup 1))
When I click on LookUp on field Subgroup 1 (picture 2 )
it works it give me the correct items (where Parent Code is Main Group and Type is Subgroup 1) , but when I click to create a new entry automatically entered in table:"Item Organizational Group" without any filters.
I tried with gRecItemOrganGroup.GetFilters(Rec) and I put on Group Code-OnValide on page , but still doese't work, it give me Type=0.
Also I tried with
SETRANGE(Type,Type::"Subgroup 1");
SETRANGE("Parent Code",'500'); onInsertRecord but doesn't work
Any advice,
Thanks0 -
Hi,
I add this code on NewRecord on page :
EVALUATE(Type,GETFILTER(Type));
EVALUATE("Parent Code",GETFILTER("Parent Code"));
and It works now.
Thanks,0
Categories
- All Categories
- 73 General
- 73 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 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
