NetTalk Central

Author Topic: Filter construction?  (Read 3858 times)

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Filter construction?
« 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

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Filter construction?
« Reply #1 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.

JohanR

  • Sr. Member
  • ****
  • Posts: 375
    • View Profile
    • Email
Re: Filter construction?
« Reply #2 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: Filter construction?
« Reply #3 on: July 29, 2014, 04:50:49 AM »
that's why programmers earn the big bucks....

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Filter construction?
« Reply #4 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é
« Last Edit: July 30, 2014, 01:59:01 AM by Rene Simons »
Rene Simons
NT14.14

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Re: Filter construction?
« Reply #5 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.