locked
Possible to get filtered child information on the parent's browse screen? RRS feed

  • Question

  • We're writing a 'case management' system that revolves around an event in the workplace-- slip and fall, burned your lip on hot coffee in the kitchen, etc.

    Related to a 'case' are people-- witnesses, investigators, etc.  As you might imagine in the database structure the 'case' is the head of the octopus, with witness and investigator tables linked to it in a 1-to-many fashion.

    Right now we're trying to craft a screen whereby we pass in a a 'Person' as a screen parameter-- and I don't mean the built-in 'Person' type from LS, but an entity of our own making.  We would like to see on the screen all cases involving that person, whether they're an investigator or witness or other.  (The witness and investigator and other entities have related links to the Person entity, so for Investigator #342 you know who that is.)

    On this screen we're working on, as one of the datasources, we have the Case table, and have selected the 'Edit Query' link to filter the listing of cases to only those involving our 'Person' parameter.

    Here's where I'm getting a bit lost.  In the filter screen itself I can easily craft something based on the fields in the Case table, but is it possible to filter based on related entities to the Case, like the Investigators or Witnesses?  Maybe I'm missing something obvious but I don't see any provision for child entity properties as filters.

    I'm pretty sure we can do a workaround by creating multiple tabs on this screen, so that for a given person we can see individual tabs listing cases in which they're Investigators or Witnesses.  But is it possible to list this all out without tabs?  Or at least without advanced stuff like getting creative with WCF RIA services?

    In short, the question is this: can I list on one screen all cases involving a person no matter their role?  Or do I need individual tabs for each role (Investigator, Witness, etc?)



    Monday, March 2, 2015 6:23 AM

Answers

  • Yes you can by creating a custom query on case. Use the PreProcess query event to filter the cases in code.

    Dave


    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    • Marked as answer by jim bancroft Monday, March 2, 2015 4:26 PM
    Monday, March 2, 2015 12:28 PM

All replies

  • Yes you can by creating a custom query on case. Use the PreProcess query event to filter the cases in code.

    Dave


    Dave Baker | AIDE for LightSwitch | Xpert360 blog | twitter : @xpert360 | Xpert360 website | Opinions are my own. For better forums, remember to mark posts as helpful/answer.

    • Marked as answer by jim bancroft Monday, March 2, 2015 4:26 PM
    Monday, March 2, 2015 12:28 PM
  • Perfect, thanks Dave.
    Monday, March 2, 2015 4:26 PM