Freezing the filters that had been applied through code!!!!!

southindian
Member Posts: 247
Dear all,
I had query. In Purchase order form there are about 2 years of data . where ever User go to list form it is displaying 2 years of data. But they expect only last one years data to be listed in list form.According to this requirement, In List form i had written code to display data for 1 years based on Work date. It is working fine. But if user is applying any othe filters other than the datafilters that i have applied .Data gets reset when they press "Show All" and again the list form shows last 2 years data.
The code written in list form is
gvdate:=CALCDATE('-CM',WORKDATE);
Recaccperiod.RESET;
Recaccperiod.SETFILTER(Recaccperiod."Starting Date",'<%1',gvdate);
Recaccperiod.SETRANGE(Recaccperiod."New Fiscal Year",TRUE);
IF Recaccperiod.FIND('+') THEN BEGIN
RecPH.RESET;
RecPH.SETCURRENTKEY("Document Type","No. Series","No.","Document Date");//004
RecPH.SETRANGE(RecPH."Document Type","Document Type");
RecPH.SETFILTER(RecPH."Document Date",'%1..%2',
CALCDATE('+1D',CALCDATE('-2Y',CALCDATE('-1D',Recaccperiod."Starting
Date"))),WORKDATE);
RecPH.SETRANGE(RecPH."Import Document","Import Document");
IF "Document Type"="Document Type"::Order THEN BEGIN
RecPH.SETRANGE(RecPH.Subcontracting,FALSE);
END;
IF "Document Type"="Document Type"::"Credit Memo" THEN BEGIN
RecPH.SETRANGE(RecPH.Credit,Credit);
END;
RecPH.ASCENDING(FALSE);
RecPH.FIND('-');
Rec.COPYFILTERS(RecPH);
END;
My query is is there any syntax to freeze the Filters i had applied .
Ever if the User is manually applying any filters , it should not affect my Already applied filters. again when they are clicking "Show All" it is showing last 2 years data, which should be 1 year.
Is there is any syntax for freezing my own set of filters.
With Regards,
Vijay
I had query. In Purchase order form there are about 2 years of data . where ever User go to list form it is displaying 2 years of data. But they expect only last one years data to be listed in list form.According to this requirement, In List form i had written code to display data for 1 years based on Work date. It is working fine. But if user is applying any othe filters other than the datafilters that i have applied .Data gets reset when they press "Show All" and again the list form shows last 2 years data.
The code written in list form is
gvdate:=CALCDATE('-CM',WORKDATE);
Recaccperiod.RESET;
Recaccperiod.SETFILTER(Recaccperiod."Starting Date",'<%1',gvdate);
Recaccperiod.SETRANGE(Recaccperiod."New Fiscal Year",TRUE);
IF Recaccperiod.FIND('+') THEN BEGIN
RecPH.RESET;
RecPH.SETCURRENTKEY("Document Type","No. Series","No.","Document Date");//004
RecPH.SETRANGE(RecPH."Document Type","Document Type");
RecPH.SETFILTER(RecPH."Document Date",'%1..%2',
CALCDATE('+1D',CALCDATE('-2Y',CALCDATE('-1D',Recaccperiod."Starting
Date"))),WORKDATE);
RecPH.SETRANGE(RecPH."Import Document","Import Document");
IF "Document Type"="Document Type"::Order THEN BEGIN
RecPH.SETRANGE(RecPH.Subcontracting,FALSE);
END;
IF "Document Type"="Document Type"::"Credit Memo" THEN BEGIN
RecPH.SETRANGE(RecPH.Credit,Credit);
END;
RecPH.ASCENDING(FALSE);
RecPH.FIND('-');
Rec.COPYFILTERS(RecPH);
END;
My query is is there any syntax to freeze the Filters i had applied .
Ever if the User is manually applying any filters , it should not affect my Already applied filters. again when they are clicking "Show All" it is showing last 2 years data, which should be 1 year.
Is there is any syntax for freezing my own set of filters.
With Regards,
Vijay
0
Comments
-
Check FILTERGROUP Function..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