locked
Zero to one relationship, how to indicate on a screen whether parent has a child RRS feed

  • Question

  • Hi everyone,

    I was hoping for some input to mull over.  I have a Parent / Child, zero-to-one relationship.  On the parent's Browse screen I'd like to indicate whether or the parent has a child record.  A text value, checkbox, something like that.

    I'm not sure how best to do it, preferably programmatically?  Maybe something in myapp.activeDataWorkspace.ApplicationData or one of the screen APIs?  Or something in conjunction?

    Monday, March 17, 2014 10:29 PM

All replies

  • Hi Jim

    Do you want to describe the relationship From Zero or one  To One ?

    A "From" must have a "To", but a "To" can have one or no "From".

    Please refer to define data relationships in LightSwitch, and make sure you understand it clearly.

    hope it helps.

    Regards


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, March 19, 2014 6:45 AM
  • Hi Angie,

    Thanks for your reply.  Yes, I want a Zero or one to One relationship.  Sorry if I wasn't clear before.

    With that said, are there ways of establishing that relationship in code?  Say, if I'm viewing a parent record on a screen and want a button that reads "create child", and creates a child record when clicked, what would the code for that look like?

    If I'm on that parent detail screen and I want to show a flag that essentially indicates whether or not there is a child record, how can I go about doing that?

    Thanks!


    Thursday, March 20, 2014 6:12 AM
  • HI Jim

    For this issue, you could take the method below into consideration.

    you can create a navigation link on the parent screen, if you click the navigation link, it will navigate to child screen.

    Moreover, you need create AddAndEdit button in screen to create new child record.

    If you just want to show a flag that essentially indicates whether or not there is a child record, we will look into it further.

    Regards


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, March 21, 2014 9:28 AM
  • Thanks Angie.  I'd be interested to know best ways to check whether there's a child record.

    Monday, March 24, 2014 6:28 PM