Custom Fields SQL FILTER

Support forum for the ViciBox ISO Server Install and ISO LiveCD Demo

Moderators: enjay, williamconley, Staydog, mflorell, MJCoate, mcargile, Kumba

Custom Fields SQL FILTER

Postby Nefariousparity » Fri Sep 21, 2012 7:25 pm

How does one go about using SQL FILTERS on custom fields. For instance, we can get custom sql filters to work with pre-loaded fields. But if we create a custom field for say if someone has a pool in their backyard, and then try to filter on that. It does not work. The only information in the column for said field is Y. There is nothing other than that...and N will show up as null in the DB. Please advise if this is even possible, and if so how would I go about getting this to work.
|| DB Schema Version: 1609 || Asterisk 11.25.1-vici || BUILD: 190902-0839 ||VERSION: 2.14-718a||SVN: 3133||10xTelephony||1x Database||1x Slave||1x Web||1x Archive||ViciBox v.8.0.1
Nefariousparity
 
Posts: 327
Joined: Wed Sep 12, 2012 7:01 pm

Re: Custom Fields SQL FILTER

Postby mflorell » Sat Sep 22, 2012 6:43 am

That is not currently a feature, the main reason is that it would slow things down tremendously in the hopper and manual dialing.
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Custom Fields SQL FILTER

Postby Nefariousparity » Sat Sep 22, 2012 1:34 pm

It is possible, because we are doing it. The feature is built into vicidial as there is options for it.
|| DB Schema Version: 1609 || Asterisk 11.25.1-vici || BUILD: 190902-0839 ||VERSION: 2.14-718a||SVN: 3133||10xTelephony||1x Database||1x Slave||1x Web||1x Archive||ViciBox v.8.0.1
Nefariousparity
 
Posts: 327
Joined: Wed Sep 12, 2012 7:01 pm

Re: Custom Fields SQL FILTER

Postby mflorell » Sun Sep 23, 2012 7:34 am

I'm confused, first you say you want to know if it is possible, then you are saying you are already doing it?
mflorell
Site Admin
 
Posts: 18387
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Custom Fields SQL FILTER

Postby Nefariousparity » Sun Sep 23, 2012 4:59 pm

I don't think you understand the question that I stated. So for me to use custom filters. I have to load data into pre built fields when I am loading a list. So for instance for my custom field to work like peple with pools the two field options are Y or N. I have to load that into a prebuilt field that we are not using like address 3. Get it? If I were to create a custom field to show next to address 3 like pools. When I do my custom SQL Filter it does not seem to work on those. :)
|| DB Schema Version: 1609 || Asterisk 11.25.1-vici || BUILD: 190902-0839 ||VERSION: 2.14-718a||SVN: 3133||10xTelephony||1x Database||1x Slave||1x Web||1x Archive||ViciBox v.8.0.1
Nefariousparity
 
Posts: 327
Joined: Wed Sep 12, 2012 7:01 pm

Re: Custom Fields SQL FILTER

Postby williamconley » Wed Mar 13, 2013 2:10 pm

using custom fields can be as easy as this (as an addition to an existing sql filter, we'll assume you already have something like "state NOT IN ('AL','FL')" and you'll be adding a custom field requirement.

To add "in_ground_pool" must be "Y":

Code: Select all
state NOT IN ('AL','FL') and lead_id IN (select lead_id from custom_1111 where in_ground_pool = 'Y')


Downside: List ID is hard coded. To get multiple lists included, you'll need to perform a "join" inside the "select" or use multiple nested "or" statements, but be careful to nest them properly.

If you require a "null" value record to be returned instead of ignored (ie: omit those with "N" but accept "Y" and NULL):

Code: Select all
state NOT IN ('AL','FL') and lead_id IN (select lead_id from custom_1111 where in_ground_pool = 'N' or in_ground_pool IS NULL)


Because of the way custom field tables are created, for maximum custom field flexibility, this is cumbersome but at least moderately possible.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to ViciBox Server Install and Demo

Who is online

Users browsing this forum: No registered users and 66 guests