How to test a value against a filter

Evert-Jan
Member Posts: 36
Hi all,
I saw already a topic about the same thing (more or less):
http://www.mibuso.com/forum/viewtopic.php?f=23&t=22303
However, that solution does not fit for my situation.
My situation:
- a value (datatype = text with length = 250).
- another value that contains a filter. Examples of a filter: '<>abc' , 'abc|def' , etc.
My question: is there an easy way to check that the 1st value matches the filter in the 2nd value?
I'm afraid there is not. But you never know. That's why I ask it here.
Thanks for reading.
I saw already a topic about the same thing (more or less):
http://www.mibuso.com/forum/viewtopic.php?f=23&t=22303
However, that solution does not fit for my situation.
My situation:
- a value (datatype = text with length = 250).
- another value that contains a filter. Examples of a filter: '<>abc' , 'abc|def' , etc.
My question: is there an easy way to check that the 1st value matches the filter in the 2nd value?
I'm afraid there is not. But you never know. That's why I ask it here.
Thanks for reading.
Regards,
Evert-Jan
Evert-Jan
0
Answers
-
Both values apply to the same field? The filter one seems to apply to an integer field, but the other one is text...
If both applies to the same field I would do it as ara3n said on the other topic. If not you'll have to give more details.
Salut!Laura Nicolàs
Author of the book Implementing Dynamics NAV 2013
Cursos Dynamics NAV (spanish) : http://clipdynamics.com/ - A new lesson released every day.0 -
To keep it easy, both values have the same datatypeRegards,
Evert-Jan0 -
Why the proposed code don't fit your needs?
Is it because you don't have any table containing all the possible values?
Salut!Laura Nicolàs
Author of the book Implementing Dynamics NAV 2013
Cursos Dynamics NAV (spanish) : http://clipdynamics.com/ - A new lesson released every day.0 -
Well, I try to explain. :-k
I'm writing some generic code that will be used for many tables.
I only have a RecordRef variable as input.
And I know you can do a FIND on a RecordRef variable.
But the function that I'm writing can be called from the OnInsert trigger of a table.
So, setting a filter on the RecordRef and doing a FIND will not work, because I even don't know if that record does already exist.
I hope this is enough explanation.Regards,
Evert-Jan0 -
Maybe I'm misunderstanding this completely but it seems to be rather easy:
If it is a generic function then use a generic table for your filtertest. It does not matter which table it is, the table just needs a field of the same type and length you want to check, thats all. Check in table 2000000041 (Field) for a table that holds such a field.
Define a table variable as some table and mark it as temporary.
Get the value from your Fieldref and store it in your Dummy table, Field x. Insert the record (thats why it should be temporary)
Apply the filter for field x and check whether you can now find a record.Frank Dickschat
FD Consulting0 -
Thanks,
That must be the solution.Regards,
Evert-Jan0
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