I would like to be able to use the datatype TableFilter, but since Navision doesn't provide a function to actually use the value I guess we have to do it our self. I'm quite sure it is possble using RecRef, FldRef and the Field table. I would just like to know if anyone wish to share their code, or at least confirm that it is possible or say why it isn't :-)
Regards
Peter
0
Comments
To transform a filter to a view on a normal variable you can use GetView.
Like
Cust.GetView
you can use that returnvalue on a RecRef
It is also possible to create the view syntax yourself. Just have a good look at the coding in tablerelations, flowfields etc. and copy this.
It is not possible to do a RecRef.SETVVIEW(MyTable.MyTableFilter). Instead I wish to make a function that can do it like this RecRef.SETVVIEW(TableFilter2View(MyTable.MyTableFilter))
A TableFilter seems to be shown like this:
<TableName>:<FieldCaption>=<FieldFilter>,<FieldCaption>=<FieldFilter>,..
I just need to "convert" this into the VIEW format, which is like this:
SORTING(<Key>) WHERE(<FieldCaption/No>=FILTER(<FieldFilter>),<FieldCaption/No>=FILTER(<FieldFilter>),...)
The only problem is if the fieldcaption includes "=" or "," (Or if the fieldcaption isn't unique in the table)
Peter
You can also leave the SORTING if you want.
Just use
We use this to put the filters on a RecRef.
I have never used the TableFilter thing.
The View is a simple string and can be saved in the database this way.
Navision uses this in the Segment Functionality.
I hope this helps you.
Peter
What we have done is created a similair form to the Ctrl+F7 thing and convert the user data to the View.
If your solution works, then this is even better. It saves a table and and a form.
Peter
Peter
EDIT: LOL nearly 5 years later I was searching for this. Still no good solution so made my own allowing nearly any character in the field or filter.