Using Date Filter in Custom Form
upasanisandip
Member Posts: 405
Hi,
I have created 1 form using table G/L Account (Chart of Accounts Overview).
Now This is customized form. I put From Date and To Date that user will enter. When user press Apply button created by me I want only those records to show. How can I do that .. Means which filter I have to use?
Any hints or suggessitoons welcome.
Thanks,
Sandip.
I have created 1 form using table G/L Account (Chart of Accounts Overview).
Now This is customized form. I put From Date and To Date that user will enter. When user press Apply button created by me I want only those records to show. How can I do that .. Means which filter I have to use?
Any hints or suggessitoons welcome.
Thanks,
Sandip.
0
Comments
-
Have you tried to use these coding as follows:
IF fromdate <> 0D THEN
SETFILTER("from date",'..%1',fromdate)
ELSE
SETRANGE("from date");
IF ToDate <> 0D THEN
SETFILTER("To Date",'..%1',ToDate)
ELSE
SETRANGE("To Date");
Rgds,
Johnsonsubscribe to:
sea-navision-community-subscribe@yahoogroups.com
detail in:
http://sea-navision-community.blogspot.com0 -
johnson alonso wrote:Have you tried to use these coding as follows:
IF fromdate <> 0D THEN
SETFILTER("from date",'..%1',fromdate)
ELSE
SETRANGE("from date");
IF ToDate <> 0D THEN
SETFILTER("To Date",'..%1',ToDate)
ELSE
SETRANGE("To Date");
Rgds,
Johnson
Ok Thanks johnson alonso0 -
I think, you want to show only these GL Accounts with Amounts in the Date Range FromDate .. ToDate
You can only use fields where the Datefilter FlowFilter has influence like e.g. "Net Change" (FlowField)
You have to implement Code behind the Apply Button like
Testing FromDate <> 0D
Testing ToDate <> 0D
setfilter(datefilter,'%1..%2',fromdate,toDate)
Calculate the FlowField "Net Change" with repeat until loop and mark all records with "net change" <> 0
after loop setfilter only to the marked records (markedonly)
Regards
Poebbles0 -
Dear All,
It's really interesting that there are two differents answers, which one is true depends on the owner of the question in this topic. He must select and try, but I am sure there is no perfect answer just by seeing not doing.
I hope to know it soon, because I am also trying what upasandip is doing right now. If one of the answers are wrong, it doesn't mean the person who gave the answer doesn't understand.
Rgds,
Mark0 -
Hi guys,
My prob. solved by using the following line code.
SETRANGE("Date Filter",FromDate1,ToDate1);
FromDate1 & ToDate1 user will provide at runtime.
The same given by Poebbles.
Thanks.0 -
upasanisandip wrote:Hi guys,
My prob. solved by using the following line code.
SETRANGE("Date Filter",FromDate1,ToDate1);
FromDate1 & ToDate1 user will provide at runtime.
The same given by Poebbles.
Thanks.
This is the correct solution, but be aware there are several fields that are affected by date filter:
Balance = Not Affected by any date filters
Balance at Date = Zero Date .. to Date
Net Change = From Date .. To Date
There is Credit Amount, Debit Amount and Budget Amount etc: as well.Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
Hi guys,
My prob. solved by using the following line code.
SETRANGE("Date Filter",FromDate1,ToDate1);
FromDate1 & ToDate1 user will provide at runtime.
The same given by Poebbles.
I think Poebbles doesn't write SETRANGE("Date Filter",FromDate1,ToDate1);
but he/she writes :...,
Testing FromDate <> 0D
Testing ToDate <> 0D
setfilter(datefilter,'%1..%2',fromdate,toDate)...
Just look at the red word, it's the different, nevertheless, you have done a good job then.
Rgds,
Johnson
"Camino Palmero"subscribe to:
sea-navision-community-subscribe@yahoogroups.com
detail in:
http://sea-navision-community.blogspot.com0 -
setfilter or setrange depends on the Software Engineer ...
If you use setrange, you don't have to test the data before because the system sets filter like "..<ToDate>" or "<FromDate>.."
If you use Setfilter the system sets filter with ' ' (empty Fields) and
an error occurs..
try it O:)
By the way.... he
0 -
isn't this more complicated then it needs to be, the g/l account table has the field "date filter" already in it,
put this field on your form and they can enter the date range there, doesn't require any coding to work0
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
- 322 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