NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: JohanR on July 29, 2014, 01:21:30 AM

Title: Filter construction?
Post by: JohanR on July 29, 2014, 01:21:30 AM

Hi,

Any easier way to contruct a browse filter instead of staring at it for a very long time and still get it wrong?
<g>

eg.

'bli:frven_isn = <39>' & 'AAAXXXXXXXXXXXXXXXX8' &'<39> and bli:active = <39>' & '1' &'<39> and bli:country_isn = <39>' & clip(p_web.GSV('loc:fc_country_isn')) &'<39> and bli:tranmeth_isn = <39>' & clip(p_web.GSV('loc:fc_tranmeth_isn')) &'<39>'

For the record, I still do not know how I managed this one.

thanks

Johan
Title: Re: Filter construction?
Post by: kevin plummer on July 29, 2014, 02:16:31 AM
3 things you can try.

1) put your filter in embed code rather than in the template
2) build your filter bit by bit if it is complex so you know what part is failing
2) switch on the template option to send the filter to debug view so you can see the end result in context.
Title: Re: Filter construction?
Post by: JohanR on July 29, 2014, 02:28:44 AM

Hi Kevin

Thank you for the reply,
Doing all 3 already, just finding it's a bit of process.


thanks

Johan
Title: Re: Filter construction?
Post by: Bruce on July 29, 2014, 04:50:49 AM
that's why programmers earn the big bucks....
Title: Re: Filter construction?
Post by: Rene Simons on July 29, 2014, 08:51:22 AM
Hi,

'bli:frven_isn = <39>AAAXXXXXXXXXXXXXXXX8<39> and bli:active = <39>1<39> and bli:country_isn = <39>' & clip(p_web.GSV('loc:fc_country_isn')) &'<39> and bli:tranmeth_isn = <39>' & clip(p_web.GSV('loc:fc_tranmeth_isn')) &'<39>'

Also you don' t need to clip the p_web.gsv('whatever' ) 's . p_web.gsv returns a clipped value already. So:

'bli:frven_isn = <39>AAAXXXXXXXXXXXXXXXX8<39> and bli:active = <39>1<39> and bli:country_isn = <39>' & p_web.GSV('loc:fc_country_isn') &'<39> and bli:tranmeth_isn = <39>' & p_web.GSV('loc:fc_tranmeth_isn') &'<39>'


Looks easier i think.
You still have to use DebugView to find out if it looks okay.

Cheers,

René
Title: Re: Filter construction?
Post by: CaseyR on July 30, 2014, 01:36:34 PM
FWIW,  I found using

SQ              EQUATE('<39>')    !Single quote

makes building and understanding complicated filters easier.   Comes in very handy if you are using STRINGS as GUIDs.