3 Replies Latest reply on Apr 22, 2014 9:42 AM by philmodjunk

    Need help displaying related field information on a form

    bokenrosie

      Title

      Need help displaying related field information on a form

      Post

           I have a layout that needs to select and display contact information.  The contacts are kept in two related tables (Company) and (Contact).  Each Company can have multiple contacts.
            
           As you create a record in the third table (notices) I want to be able to search for a contact from the above tables in a portal or search box and then have it copy related contact and company information to that third table.  I don't want to link the related information, it has to be copied because contacts sometimes change but the notice record should remain faithful to the calendar and how it was when created.
            
           I have built out the notice part.  I have built out the contact/company part.  Now all I need is a way to get info copied.
            
           Any help would be greatly appreciated.
            
            

        • 1. Re: Need help displaying related field information on a form
          philmodjunk

               There are two approaches you can use for selecting this info:

               1) you can select a contact and both the contact and company info is copied into fields of your notice record

               2) you can select a company and this narrows your choice of contacts to just those listed for that company giving you a much shorter list from which to select a contact.

               Either way, auto-enter field options can copy the data from your related company and contacts tables once you have made a selection. Drop down lists, pop up menus or search portals may be used with either option 1 or 2 as a way to select that contact.

               Narrow down what you want to do by selecting from these options and then I can describe that option in more detail if you need me to.

          • 2. Re: Need help displaying related field information on a form
            bokenrosie

                 I've taken some time to look at my project and some other interfaces that make sense. 

                 Best solution would be a Search button brings up small window with search field.  User enters something in that box and clicks search.  

                 We display a list of results with Company, First Name, Last Name (note from two different tables)

                 User selects the row they want and hits a button on that window and the resulting data is copied to the relevant fields in the main layout.

                 Am I asking for the moon here?  I can go simpler but if this is not hard to build it would be my first choice.

                 Thanks for the advice.

            • 3. Re: Need help displaying related field information on a form
              philmodjunk

                   You aren't asking the moon. It's not that complicated. And there is more than one solution that matches what you describe.

                   But:

                   

                        Search button brings up small window with search field.  User enters something in that box and clicks search.

                   Is a bit vague. What kind of criteria might they be entering into the that "box"? Are they searching for a contact or a company when they enter this info?

                   You can open a custom dialog  with up to 3 input fields or a floating modal window with as many fields (boxes) as you need for specifying the search criteria. I'd have the user input this data into a field with global storage while in Browse mode. Then a script can use that criteria to perform a find and count the number of records found. If more than one record is found, the found set is displayed in a list view where the user can see more detail about each option and click a button--which can be the entire row of data, to select that record. (but would that be a contact record or a company record?).

                   This thread on scripted finds will provide a basis for the method that I just described: Scripted Find Examples

                   But this is not the only method that matches what you describe. Your "box" could also be a field placed above a portal that automatically updates with each character entered in to the search field to show fewer and fewer matching records in the portal. Clicking a portal row--which has been formatted to be a button, then selects that contact (or would it be a company?).