NetTalk Central

Author Topic: NT8 - NetWebBrowse Filter - BINDing a procedure  (Read 3585 times)

David

  • Full Member
  • ***
  • Posts: 127
    • View Profile
NT8 - NetWebBrowse Filter - BINDing a procedure
« on: April 01, 2015, 05:01:47 PM »
I have a many to many relationship and am using a 3rd table to link the other two.  In a NetWebBrowse I want to filter if there is a record in the link table.  To do this, I have a source procedure, TagLink(string xTagRecordID, string xMyRecordID), LONG.  This procedure returns a 1 if there is a link between the two tables.

My filter is: 'TagLink(TAG:TagID, p_web.GSV(<39>OBJ:ObjectID<39>)) = 1'

I am assuming I need to do a BIND('TagLink', TagLink) at the beginning of NetWebBrowse procedure so that it will work correctly in the filter.  However, C10 is giving me the following compile error on the BIND line of code.

Attribute variable must have string type

Is there a different way to do this or am I missing something on BIND?

Thank you for your assistance.
David

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NT8 - NetWebBrowse Filter - BINDing a procedure
« Reply #1 on: April 01, 2015, 11:08:34 PM »
Hi David,

>> I have a many to many relationship and am using a 3rd table to link the other two.  In a NetWebBrowse I want to filter if there is a record in the link table.  To do this, I have a source procedure,

That's a really bad (ie inefficient and very unSQL friendly) way to do it. It would be a lot better to just add a Join tothe link table, then apply a client side filter (if you're trying to make a list of "unlinked" items) or (if you are trying to show only linked items in the list) then make the Join an OUTER join.

Come to the user group Today (7am Pacific, 10am Eastern) and we can go through this if you like.

>> Attribute variable must have string type

this is probably cause by your TagLink procedure having a parameter of type other than string. (All parameters on BINed procedure must be a string.)

But this forces the _whole filter_ to be client-side (including any range limits) so is absolutely the worst possible way of filtering the browse. If you must do client side filtering add code to the ValidateRecord embed point - do not add it to the template Filter.

(Incidentally this is true for NetTalk or ABC or Legacy apps as well.)

Cheers
Bruce