Filter AND (use 2 more fields)

casanova
Member Posts: 194
Hi All,
i want to filter data with 2 fields when i do open page
how should i do that?
Thanks
i want to filter data with 2 fields when i do open page
how should i do that?
if FieldA = blank and FieldB = blank then
dont show
Thanks
0
Comments
-
trigger OnOpenPage Setfilter(fieldA, '<>%1', ''); Setfilter(fieldB, '<>%1', '');
this will show only records, where A and B populated. Of course, depending on your fileds datatypes you have to set right stuff in " ''); "
0 for integers and options, '' for code and text, '0d' for date, 0t for time, etc...0 -
It's actually an OR that you are looking for, the AND you get for free: all filter conditions must be fulfilled. And since a filter is always inclusive, not exclusive, what you really need is
FieldA <> '' OR Field B <> ''
NAV does not provide for this. You need a work around.
Some of your options:- a FlowField
- A field that you calculate OnInsert/OnModify
- MARK(TRUE)/MARKEDONLY(TRUE)
- SourceTableTemporary=Yes
- Some Code in OnFindRecord/OnNextRecord
- a Query object
0 -
vaprog wrote:It's actually an OR that you are looking for,
I cant seeif FieldA = blank and FieldB = blank then hide recordbut in any case, I agree that OR will not be doable, for OR probably most viable option is OnFindRecord and OnNextRecord triggers. The warehouse shipments are great example of implementation OnFindRecord and OnNextRecord.
0 -
ppavuk wrote:
trigger OnOpenPage Setfilter(fieldA, '<>%1', ''); Setfilter(fieldB, '<>%1', '');
this will show only records, where A and B populated. Of course, depending on your fileds datatypes you have to set right stuff in " ''); "
0 for integers and options, '' for code and text, '0d' for date, 0t for time, etc...
if we do this then either Field A blank or Field B blank then will be filtered
i only want to hide if both fields are blank0 -
Try to run your page, using a code like this:
repeat
if (NOT yourRecord.fieldA=' ') and (NOT yourRecord.FieldB=' ') then begin
yourRecord2 := yourRecord;
yourRecord2.insert;
end;
until yourRecord.next=0;
RUN(pageID, yourRecord2);
where yourRecord is a Record variable and yourRecord2 is a temporary Record variable of the same table.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