NetTalk Central

Author Topic: Filters and locaters using MSSQL  (Read 8626 times)

ajosuna

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • Email
Filters and locaters using MSSQL
« on: April 29, 2008, 06:49:58 AM »
Hi Everyone:

I have a browse with the following filter. Records are returned fine. However, when I sort any of the columns the locater doesn't work and I get no records.

'HDH:txCOMID = ''' & clip(p_web.GetSessionValue('SV:CompanyRecID')) &''''

What is causing this?

Regards

Anthony

Alan Telford

  • Jr. Member
  • **
  • Posts: 81
    • View Profile
Re: Filters and locaters using MSSQL
« Reply #1 on: April 29, 2008, 01:00:20 PM »
http://www.nettalkcentral.com/index.php?option=com_smf&Itemid=36&topic=288.0;topicseen

Try the above link. It is a slightly different problem, but the solution is the same, in that you need to embed some code in the _SendFile method of the WebHandler procedure.

I have a static link with a name of "datasmart_importsales_sample.csv" which I want to ensure has the option of SAVE AS.
The following is code in my _SendFIle method.

  case SELF.GetPageName(Lower(p_FileName))
  of  'datasmart_importsales_sample.csv'
    p_filename = filepathonly(p_filename) & filenamenoextension(p_filename)
  end

Use the idea and adapt for your needs.
Regards,
Alan
PS Also try a search on _SENDFILE in this forum for other threads on this topic.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Filters and locaters using MSSQL
« Reply #2 on: April 30, 2008, 07:24:42 AM »
Hi Anthony,

you can ignore Alan's reply. He posted it to the wrong thread. It was aimed at a different thread. You'll just have to forgive him. He's from, um, well, New Zealand, and they do things differently there  ;)

With regard to your filter, there's nothing wrong with it that I can see. The only recommendation I'm make is to drop the Clip. All NetWeb methods, that return a string, return the string already clipped for you.

'HDH:txCOMID = ''' & p_web.GetSessionValue('SV:CompanyRecID') &''''

Given that the filter looks ok, perhaps tell us more about your locator.What locator type are you using?

cheers
Bruce

ajosuna

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • Email
Re: Filters and locaters using MSSQL
« Reply #3 on: April 30, 2008, 09:54:58 PM »
Hi Bruce:

I am using the standard column sorting using the contain or begins with. In both cases no records are returned.  'HDH:txCOMID = ''' & p_web.GetSessionValue('SV:CompanyRecID') &'''' should always be added to the locater filter since this is a multi company site.

Regards

Anthony


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Filters and locaters using MSSQL
« Reply #4 on: May 01, 2008, 12:01:46 AM »
Hi Anthony,

Ok, it's possible something is wrong with the locator. Try the positional locator and see if that works? (just as a test).

You don't mention what data files you are using - but if TPS I'd be very keen if you could send me the sample app, dict & data...

cheers
Bruce

ajosuna

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • Email
Re: Filters and locaters using MSSQL
« Reply #5 on: May 01, 2008, 07:36:35 AM »
Hi Bruce:

The positional locater works. There is a problem with the contain and starts-with. This app is using MSSQL. I like the column sorting with the locater because our customers already know how to use it. It would be nice to have one locater that searches all the columns you choose in the NetTalk template. I guess I could create a search form and then call the browse. I saw an example here. That would require an extra procedure for each browse  ???


Regards

Anthony

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Filters and locaters using MSSQL
« Reply #6 on: May 02, 2008, 03:27:32 AM »
Hi Anthony,

I'll investigate the other locators to see if they've stopped working. I'll let you kow if I need an example, but I'll try with the other examples in the meantime.

Regarding a multi-column locator. Would you see multiple entry fields (one for each column) or ne entry field that searches across multiple columns for a specific word ?

Cheers
Bruce
 

ajosuna

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • Email
Re: Filters and locaters using MSSQL
« Reply #7 on: May 02, 2008, 08:40:52 AM »
Hi Bruce:

Thanks for creating this great product. Please let me know if you find anything. Regarding the multi-column locator, I would say one entry field that searches multiple columns. Most users are familiar with Search Engine queries. In an order entry system, customer number, company name, and the contact name could be added to a Search tab in a NetTalk browse procedure. I would really like to see this added to the list. This will save a lot of time. :)

Regards

Anthony

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Filters and locaters using MSSQL
« Reply #8 on: May 02, 2008, 11:50:24 PM »
Hi Anthony,

The "search" question is, I think, somewhat different to a multi-column locator. As you say, users are used to "google search" and as we build sites that are content related (as most are) then searching becomes somewhat more complicated than just a filter on a browse. It is something we're looking into though.

I'll keep you posted on the msSql question.

Cheers
Bruce

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Filters and locaters using MSSQL
« Reply #9 on: May 05, 2008, 01:17:39 AM »
Hi Anthony,

I've discovered, and fixed, the bug with the Contains and BeginsWith locators. Obviously the fix will be in 4.31 (which I plan a public beta of this week.) If you need the fix urgently though, email me your current \clarion6\libsrc\netweb.clw and I'll make the fix to that for you.

my address is my name at capesoft dot com.

cheers
Bruce

Poul

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: Filters and locaters using MSSQL
« Reply #10 on: May 05, 2008, 11:08:52 AM »
Hi Bruce,

I don't know if its related, but I was going to send you something, i finally figured out why my filters / locators were being unpredictable.

I am using a session value to pass the filter to a browse - and i discovered I must enclose the filter within brackets othewise the locator could create unintended results:

eg   Fld1= True or Fld2 > 0  And Locator=X
but intended   (Fld1= True or Fld2 > 0)  And Locator=X

(i suspect even a template entered filter/range limits might have the same problem, without the brackets??)

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Filters and locaters using MSSQL
« Reply #11 on: May 05, 2008, 11:31:01 PM »
Hi Poul,

Good thinking! Yes, although this isn't Anthony's problem, it's definitely worth handling. I've tweaked the code to correctly handle this case.

Cheers
Bruce