3 Replies Latest reply on Feb 23, 2016 7:43 AM by Mike_Mitchell

    Relationship Question

    Ben_B94

      Hi,

      Current tables,

       

      Staff >---- Locations ------< Tools ------< SignOut

       

      1 location can have many staff and many tools can be in one location. Everything is based around where something is.

      My confusion lies with the Signout table. It does contain some things independent of a location like date signed out for a tool etc.

      What I want is basically a bunch of drop downs that make it easy to quickly fill in a sign out form but my dropdown's.keep coming up empty. Can my sign out layout 'see' the staff members or the locations? If I just drag the staff::staffname field from the field picker on my signout layout and make a drop down or pop up list of the names, nothing happens. Alternatively I tried with the primary key and then used merge fields that would show data related to whatever ID I picked but again nothing appears for the list or for a pop up.



      Thanks 

        • 1. Re: Relationship Question
          Mike_Mitchell

          Ben_B94 wrote:

           

          Can my sign out layout 'see' the staff members or the locations? If I just drag the staff::staffname field from the field picker on my signout layout and make a drop down or pop up list of the names, nothing happens.

           

          Yes, you can "see" the staff members and locations from the signout layout, but only if there are related records there. Think of the Relationships Graph as stepping stones in a river. As you move from TO to TO, a filter is automatically applied to match the records that meet the relational criteria. So, for example, if I'm on a signout record, I will see the Tool record corresponding to that signout. I will see any Locations records related to that tool, and I will see any or all Staff records related to that set of Locations.

           

          So what's going on here? Your drop-down will be empty if there are no matching records. It's a chicken-and-egg situation; you can't create the records until you have an option in the drop-down, but you won't have any options in the drop-down unless there are matching related records.

           

          Therefore, you have to base your value lists on something other than the relationship. You can base them on the entire contents of the table, or you can build additional structure to support the list you want to see. Other options include pop-up windows or popovers with the allowable options and scripting to support the creation of records or insertion of primary keys.

           

          HTH

           

          Mike

          • 2. Re: Relationship Question
            Ben_B94

            Thanks for the reply, I think I am now beginning to understand.

             

            For:

             

            if I'm on a signout record, I will see the Tool record corresponding to that signout. I will see any Locations records related to that tool, and I will see any or all Staff records related to that set of Locations.


            So what would happen if say a staff member changed job to a different location. Would it be possible to have a way to change this from the sign out sheet instead of having to go back to the staff layout and change the location ID_fk to the new job?


            Thanks

            • 3. Re: Relationship Question
              Mike_Mitchell

              Sure. You can do it a couple of ways:

               

              1) Build one or more new relationships from the current context to the destination context, based on a global field in the current context. Set the global field to the ID you want, and presto! The related record is the one you want.

               

              2) Use something that extends this concept like the Selector-Connector model. (Google it. Pretty cool.)

               

              3) Create an offscreen window, go to that layout, find the item, update the field, and close the window.

               

              4) Use Perform Script on Server to accomplish 3.