4 Replies Latest reply on Jun 26, 2014 3:15 PM by ribeye

    2 fields needed (other than ID) to allow users to identify unique pop up items-How to do?

    ribeye

      I'm working on my first DB solution and ran into an item that I do not understand how to resolve. I am very novice and am simultaneously working though the advanced tutorial.

       

      I am trying to provide a method for users to assign a Job Ad to an Application received from a Candidate. From a user's perspective, a unique Job Ad can only be identified by a combination of 2 fields (start_date and Posting_Location). My hope is to allow users to use a single pop up menu to select from the historical list of job ads (displayed showing those 2 fields) and then after it is selected, it would be displayed on the layout showing those same 2 fields within the single field.

       

      In FM if I use the Ad's ID in a field value list, it only allows me one other field to display for the user which is not adequate for them to know which item to choose, and it also eliminates some duplicates that need to be shown.

       

      I attempted creating a calculation field titled c_Ad_Particulars, set to display as text to combine the 2 fields into one, but recieved an error showing it needs to be an idexed field. I found a posting about assigning the calculation a global storage, but am still unable to get it to work.

       

      The only other option I could think of was to use a portal and allow a user to select one of the records to populate the field and assign the ID. I'm not clear how to do this either, and would prefer the pop-up or a drop down menu if possible.

       

      I've attached the ERD, and the calculation for c_Ad_Particulars is: Start_Date & ads_Location::Posting_Location

       

      I would appreciate any instructions on how to achieve one of the solutions above or other possible ways to achieve the same effect. Thank you!

        • 1. Re: 2 fields needed (other than ID) to allow users to identify unique pop up items-How to do?
          Mike_Mitchell

          Welcome to FileMaker.

           

          You're on the right track with a List view (or a portal, really). What you can do is, instead of attempting to build a unique identifier based on what the user sees (i.e., date and location), use the existing unique ID for the ad. Store that in a variable when the user clicks on the item he wants. Return the user back to the appropriate layout, then store the ID value in the FK_ads_ID field.

           

          Voila. Your relationship is set, and you've accomplished your task.

           

          HTH

           

          Mike

          • 2. Re: 2 fields needed (other than ID) to allow users to identify unique pop up items-How to do?
            ribeye

            Thank you for the tip!  I understand the logic in what your saying, but the technique is beyond me at this phase of my learning.  I've been looking into setting variables from user input and haven't found out how to do that yet.  I'll do some more digging this evening.

             

            To make sure I understand, I would actually need to set two variables, correct?  The current Application Record ID that I am starting in, then switch to new list view layout for Ads, set the variable for the appropriate Ad record (based on user input) then return to the Application Record recorded in the first variable, then assign the second variable to the appropriate field in the Application Record..??

             

            I suspect I am over complicating this.  Is there any other simpler way from a child record to view a list of parent records to select from.  The reverse is so easy via a portal, seams that FM would have provided a simpler tool to look at a list of items in parent from child.

            • 3. Re: 2 fields needed (other than ID) to allow users to identify unique pop up items-How to do?
              Mike_Mitchell

              Typically, no, you wouldn’t necessarily need to set two variables. The normal process would be to spawn a second window (or use a popover) so that your original found set is undisturbed. (Although you usually don’t lose the original found set in the original context anyway.) When you return to the original layout (context) or window, the record you started with should still be the original record (unless something caused it to change).

               

              As to your second question, it largely depends on what you mean by “list of parent records”. If you have a many-to-many relationship (where each child can have more than one parent), then you can just use a portal. If it’s a one-to-many relationship, then each child record only has a single parent, so you can just put the related fields directly on the layout.

               

              So I’m not entirely sure what you’re asking.

              • 4. Re: 2 fields needed (other than ID) to allow users to identify unique pop up items-How to do?
                ribeye

                Thank you Mike, your feedback nudged me in the right direction.  Lots to learn still