NetTalk Central

Author Topic: Filter child browse  (Read 3668 times)

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Filter child browse
« on: January 24, 2013, 12:36:08 AM »
Dont know why I am so challenged by this, but I have a parent browse (category) with. Child browse (person) as a child, and appears on the right. What is the right approach for filtering the child with just the category selected on the parent form?
Mike Grigsby
Credify Systems
Central Oregon, USA

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Filter child browse
« Reply #1 on: January 24, 2013, 01:40:27 AM »
on BrowsePersons add a Conditional Filter.
Condition is "Child of BrowseCategory"
and then set some appropriate Range fields. (Usually File RelationShip if one is set in your dict.)

cheers
Bruce

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Filter child browse
« Reply #2 on: January 27, 2013, 08:08:51 PM »
Thanks Bruce. I think my issue is that I can't seem to get the category info in order to filter the child browse. I thought I read something about capturing a row ID or something. If I try to get the category info, it is blank or zero.
« Last Edit: January 27, 2013, 08:31:30 PM by Mike Grigsby »
Mike Grigsby
Credify Systems
Central Oregon, USA

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Filter child browse
« Reply #3 on: January 27, 2013, 09:49:14 PM »
my guess is you've encountered a "bad" dictionary relationship. By which I mean, the child table is linking to the parent table, but on fields other than the parent table primary key.

let's go through the steps;
Table A has a primary key, on field A.
Browse on Table A uses the primary key, so the RowId of the table contains field A.

Now (I suspect in your case) your child browse on table B is linked to the table A, but NOT on field A. Since only field A is included in the Row Id you need to do more work to load the rest of the record of table A before the filter can be applied.

Two solutions;
a) get your database layout right OR
b) in the child browse procedure, in the generateBrowse routine, load the parent record (priming the Field A frmo the session value) then copy the other fields to the session queue.

cheers
Bruce