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.
0
Comments
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
sea-navision-community-subscribe@yahoogroups.com
detail in:
http://sea-navision-community.blogspot.com
Ok Thanks johnson alonso
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
Poebbles
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,
Mark
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.
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
I think Poebbles doesn't write SETRANGE("Date Filter",FromDate1,ToDate1);
but he/she writes :
Just look at the red word, it's the different, nevertheless, you have done a good job then.
Rgds,
Johnson
"Camino Palmero"
sea-navision-community-subscribe@yahoogroups.com
detail in:
http://sea-navision-community.blogspot.com
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
put this field on your form and they can enter the date range there, doesn't require any coding to work