NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: Mike Grigsby on November 19, 2013, 01:01:03 PM
-
I'm filtering a browse (I'm using a bit of short hand here, because I actually do this in the browse filter loop embed), but I need to evaluate if a member type is an "a" or a "m", then show records that are not disabled but have been vetted by the administrator.
So this works:
'USE:MemberType=''m'' AND USE:Vetted=''1'' AND USE:Disabled=''0'''
But I need to check two member types, and this does not work:
'USE:MemberType=''m'' OR USE:MemberType=''a'' AND USE:Vetted=''1'' AND USE:Disabled=''0'''
I can't get my head around it. I can't figure out how to isolate the OR. Thanks in advance.
-
try
'(USE:MemberType=''m'' OR USE:MemberType=''a'') AND USE:Vetted=''1'' AND USE:Disabled=''0'''
-
Also good to make sure the fields are declared in the "View Fields" template section of the browse.
-
>> Also good to make sure the fields are declared in the "View Fields" template section of the browse.
actually this has no benefit. It doesn't do any harm, but fields used in the filter, or order, are not required to be in the VIEW.
cheers
Bruce
-
Bruce,
Serious? I can distinctly remember times when, in my custom filter (embed code, not using the template), if I didn't have them in VIEW FIELDS that it wouldn't work.
So they don't need to be there.
Will have to do some testing.
My whole world has turned upside down.
-
Hi Stu,
>> (embed code, not using the template),
so let's be clear.
If you are using a field in the prop:filter of the view - in other words using either the template setting, or hand-coding a prop:filter, then the field does not need to be in the VIEW.
If you are adding code inside the "Validate Record" embed, and doing "client-side" filtering to discard records you don't want, then you absolutely _DO_ need any references here to be in the VIEW.
Of course, adding to the prop:filter is better where possible because it is then filtered by the (database) server, before it is set to the web exe.
Cheers
Bruce
-
Grandma. Eggs.
Thanks Bruce .. I'm not talking about ValidateRecord no. Talking about using loc:FilterWas in the Set Filter embed for the browse, and assigning to the prop:filter.
I guess I was confused though. About needing them in View Fields. Perhaps I was thinking of setting custom field values or something.