Hi!
I need to make a filter in txo fields in the same table, asking about the same value.
Example:
Field1 --> Owner
Field2 --> Buyer
I want to see all items that have a USER like owner OR buyer. (USER is a value in Owner field and Buyer field)
I'm looking this:
SETFILTER(Field, String [, Value] ,...) but, with this, i can make a filter only in a field, asking about two or more values.
How can i solve this?
Regards
Comments
You can work with marking the records, or preferrably temp tables... :-k
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I've a Form, when a user open the form, in the OnInit there is a filter that only can see only item that user is owner. There is another field, Buyer. Maybe user can be buyer but not owner. I want this item can be seen by this user.
Now, this is the filter in OnInit:
SETRANGE(Owner,USERID);
Imagine: USERID = 'Peter';
Table
I want to see items 001, 002 and 004 in the form.
Actually with the filter ( SETRANGE(Owner,USERID); ) only can see 001 and 004.
Or you loop the records and mark them (or use a temptable).
Or you create a new field with both Owner and buy in them (e.g. ",Peter,Anna," with a , before AND after the names).
Then you can filter on the new field:
SETFILTER("New Field",'%1','*,Anna,*');
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
RIS Plus, LLC
I think he wants (Buyer = peter) or (Owner = peter) .
Fundamentally though you need to rethink the design of the database. Work out all the scenarios before building the structure. If you had build this with a table where Owner/Buyer was an option string, then the primary key was
Item No., Owner type, Code
then a simpl flow field could do this with out any programming.
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
True we don't know the whole story, and this one filter requirement may be the only case not handled by the way its done. Its just that its quite normal when one such requirement comes along, and it the sort of work, the client soon asks for another mod, and then another. The cost of a table is generally far less that the cost of programming and working around.
But re-reading everything, probably in this case you are right, and my solution is maybe a bit of an overkill.