Table Filter question. Any assistance please?
merril
Member Posts: 38
I want to set a filter on the Fixed asset table where the "component of main asset" field is = to blank or is equal to the asset no. Is this possible?
I tried something like this
rFixedAsset.setfilter(rFixedAsset."Component of Main Asset",'%1|%2','',"FA No.");
but this does not work as the field FA No is not found. Is there another method to do this.
Thanks in advance.
I tried something like this
rFixedAsset.setfilter(rFixedAsset."Component of Main Asset",'%1|%2','',"FA No.");
but this does not work as the field FA No is not found. Is there another method to do this.
Thanks in advance.
0
Comments
-
A..Z
A range from A to Z
A | G
A or G
F.. & *A/S
A range from F and A/S is included in the field.
<>B
All except B
<>''
All not blank
<=200 | >500
All less than or equal to 200 or greater than 500
Using a filter with replacement field:
This filter selects all accounts in the range from 100 to 200 and No. 300
"G/L Account".SETFILTER("No.", '%1..%2|%3', '100', '200', '300');
Using a filter entered directly in a string:
This filter, which is entered as a string, corresponds to the previous example. It too selects all accounts in the range from 100 to 200 and No. 300.
"G/L Account".SETFILTER("No.", '100..200|300');
Documentation Feedback
from nav help
http://nav2009.blogspot.com/0 -
Hi mouliyadav,
Thanks for the info but those examples will not work for what I am trying to do. I am not trying to filter a field for certain values. I need to filter on field according to the value of another field.
In sql terms the where clause would be as follows:where "Component of Main Asset" = "" or "Component of Main Asset" = "FA No."
An alternative would be to read all the records in the table and then use an IF STATEMENT to determine if the current record meets that criteria. I would however rather not do that as that would mean that each all the records in the table must be read each time, and that to me is poor design0 -
Your setfilter statement is correct.
I would do this to check if the filters you put are correct:MESSAGE('<%1>',rFixedAsset.GETFILTERS);Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
kriki wrote:Your setfilter statement is correct.
I would do this to check if the filters you put are correct:MESSAGE('<%1>',rFixedAsset.GETFILTERS);
The program will not compile because it says that "FA No." is an unknown variable. I do not want to filter on a variable. I need to filter on another field in the table0 -
MBerger wrote:
Unfortunately, that's not possible in NAV using filters. You'll have to do that via code inside the loop.merril wrote:...I need to filter on another field in the table
So I am going to have to resort to reading all the records each time and then using an IF STATEMENT to ignore the records that I dont need0 -
That is the general idea, yes.merril wrote:MBerger wrote:
Unfortunately, that's not possible in NAV using filters. You'll have to do that via code inside the loop.merril wrote:...I need to filter on another field in the table
So I am going to have to resort to reading all the records each time and then using an IF STATEMENT to ignore the records that I dont need0
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
- 329 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