Saving the value of a flowfilter

Pedro_V.
Member Posts: 4
Hello!
Im trying to filter a table (Employee) with the value from a flowfilter (AuxRecord.Filter) which is on another table (AuxRecord). its datatype is text30. Here's the code.
The problem is that the flowfilter has no value on this code and nothing is filtered. #-o
Can you guys please give me a hand?
Best regards.
Im trying to filter a table (Employee) with the value from a flowfilter (AuxRecord.Filter) which is on another table (AuxRecord). its datatype is text30. Here's the code.
Employee.SETRANGE(Employee.Status,0); IF NOT AuxRecord.GET(AuxRecord.AuxCode) THEN ERROR('ERROR'); AuxFilter := AuxRecord.GETFILTER(AuxRecord.Filter); Employee.SETFILTER("No.", AuxFilter); END;
The problem is that the flowfilter has no value on this code and nothing is filtered. #-o
Can you guys please give me a hand?
Best regards.
0
Comments
-
This would work, if the AuxRecord had the filter hard-coded (which is not likely).
Employee.SETRANGE(Employee.Status,0);
IF NOT AuxRecord.GET(AuxRecord.AuxCode) THEN ERROR('ERROR');
Employee.SETFILTER("No.", AuxRecord.Filter);
END;
What you really want is for the AuxRecord to have been passed in, by Var, from a form / function, and have code like this (pretend this is a function)
function parameter _AuxRec (by var)
Employee.SETRANGE(Employee.Status,0);
Employee.SETFILTER("No.", _AuxRec.FlowFilterFieldName);
Employess.calcfields(..., or FIND...
-a0 -
That's just not what flowfilters are there for. Flowfilters in table A are there to manipulate flowfield values in the same table, not to be used as regular filter expressions in table B.0
-
awarn wrote:This would work, if the AuxRecord had the filter hard-coded (which is not likely).
Employee.SETRANGE(Employee.Status,0);
IF NOT AuxRecord.GET(AuxRecord.AuxCode) THEN ERROR('ERROR');
Employee.SETFILTER("No.", AuxRecord.Filter);
END;
What you really want is for the AuxRecord to have been passed in, by Var, from a form / function, and have code like this (pretend this is a function)
function parameter _AuxRec (by var)
Employee.SETRANGE(Employee.Status,0);
Employee.SETFILTER("No.", _AuxRec.FlowFilterFieldName);
Employess.calcfields(..., or FIND...
-a
let me try to explain you guys better.
what i really want to do is:
the AuxRecord table is a kind of "setup table" and the report will run according to the parameters that i setup in the table AuxRecord; and one of that parameters is that flowfilter (AuxRecord.Filter).
so i want to setup a filter previously, save it on the field AuxRecord.Filter, and then apply it to the dataitem. maybe setting that field (AuxRecord.Filter) as a flowfilter isnt the best solution... :-k
the reason for it be a flowfilter is that i want to validate the filter before i apply it, or else i can write "abcdefg" on that field and when applied it wont filter anything...
hope i have explained it well...
Best regards0 -
Edited Post[/u]0
-
I hope I understand you.
Maybe you can add a new flowfilter to the resource table and use the setup table to save the last applied filter. This way the setup table field can be a textfield.
Hey! I see nice christmas emoticons0 -
I agree - the setup table should contain a value, as opposed to a flowfilter - otherwise you will have to set the filter on the setup table somehow, then transfer that filter to the Aux table... If it was just a field then you could set the flowfilter based on the value in the field.
-a0
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