Hmm.
Problem: I Would Set a Filter ...
I Have 3 Boolean Fields, ...
Field1 can be TRUE or FALSE
Field2 can be TRUE or FALSE
Field3 can be TRUE or FALSE
I Would Select all Data where Field1 is FALSE and Field2 is TRUE and Field3 is TRUE.
If i make:
SETRANGE(Field1,FALSE)
SETRANGE(Field2,TRUE)
SETRANGE(Field3,TRUE)
It doent's appears Data.
How must i code this ?
Here Example for Datarows:
. |Field1 | Field2 || Field3
1|False || TRUE || FALSE
2|False || FALSE|| TRUE
3|TRUE || TRUE|| FALSE
4|False || TRUE|| FALSE
5|TRUE || FALSE|| TRUE
I will select Row 1,2,4
But this don't work with:
SETRANGE(Field1,FALSE)
SETRANGE(Field2,TRUE)
SETRANGE(Field3,TRUE)
because after setting second SETRANGE there are not data for filtered the third SETRANGE.
hmmm
:-k :-k
Thanks
(Oo)=*=(oO)
0
Comments
SETFILTER(<Fieldname1>,'%1',false);
SETFILTER(<Fieldname2>,'%1',true);
SETFILTER(<Fieldname3>,'%1',true);
SB.
CASE <Field 1> begin
<field 1> := true then
<condition>
CASE <Field 2> begin
<field 2> := false then
condition... and so on.
SB.
hmm :-k
Perhaps problem is that after the setrange i start a form like:
FORM.RUN(50015);
i would get filtered my data in the new form, #-o
Perhaps i must use a SETTABLEVIEW ?
But trying with:
FORM.SETTABLEVIEW(Rec);
it says me that variable SETTABLEVIEW is not defined
](*,)
:-k
The Form that i call have not source in property SourceTableView
-a
In a Form(50005) i have a Button with C/AL COde in onPush Trigger (followCode)
in Global Vars of Form 50005 i have an Variable "myRec" thats record Data Table 50011
Now i have follow idea, make a new field , a flowfield that checks if FIELD2 or FIELD3 is TRUE, and later (above) i must set only one filter to my new flowField. or similar, hmm :-k
Thanks
Try using myrec.RESET before setting the filters.
Or perhaps make myrec a local variable?
Also are you absolutely sure that there is data in the table that matches the criteria you are setting? (all 3 fields must be TRUE)??
Sorry but I do not understand.
How can you expect to receive any data if none of the lines of yoir dataset fit into your filter:
Field1=FALSE AND Field2=TRUE AND Field3=TRUE
???
try it with: or with it looks like Field2,Field3 are not determining for your selection?
br
Josef Metz
Josef Metz
Your sample data does not contain any record that matches the filters of Field1 = FALSE AND Field2 = TRUE AND Field3 = TRUE.
IF you are trying to display all records where Field1 is FALSE OR Field2 is TRUE OR Field3 is TRUE then you might try the following... If you need to restict the user from clearing the MARKEDONLY filter then set it inside a filtergoup. Hope this helps.
This will work exactly (i think), but i don't like MARK:
Change
on
Thanks first for you answers, for explain it more detailment, i can say, that in mysql i would did make it so:
SELECT * FROM TABLE WHERE ((Field1=True) AND ((Field2=True) OR (Field3=True)))
Now i would read and see your examples, and try to finish this my exercise
the correct code for your request is that from "zarryn" with a little modifications:
br
Josef Metz
Josef Metz
Hi, and Thanks you all =D> =D>
Now i have it working and seems work 100% correct \:D/
i don't have remember that can use Mark :oops: O:) :whistle:
Well i get now finished my exercice and then drin k a cup of coffee of you slainte, cheers