1 2 Previous Next 22 Replies Latest reply on Jul 17, 2016 12:14 PM by rawsoft

    Drop down list

    rawsoft

      I am trying to create a dialog box with a drop down list. When you click an item in the list, it should open a layout. I thought it would be simple but it is not (at least not for me) I have experimented with join tables etc. but no luck. Any ideas welcome.

        • 1. Re: Drop down list
          Benjamin Fehr

          Set a Script Trigger 'OnObjectModify' for that field with a associated script "Open My Layout":

          (- new window)

          - go to Layout [MyLayout]

          • 2. Re: Drop down list
            rawsoft

            Thanks for the prompt reply. I do not want the items in the drop down list to be associated with a field. When a user clicks an item on the list, I want a script to open the relevant layout - filtered using the words in the drop down list. Hope this is clear.

            • 3. Re: Drop down list
              bigtom

              If you want to display a drop down list it needs to be associated with a field of some sort. In this case a global field is usually used to store the filter parameter.

               

              Use a popover and not a true "dialog box".

              • 4. Re: Drop down list
                rawsoft

                Thank you. I will try this and see if I can get it to work.

                • 5. Re: Drop down list
                  rawsoft

                  Hi BigTom

                  I have tried your suggestion but am stuck. I have created a global field but it will only hold one item of data. I cannot therefore use it as the source of the drop down list (popover) I have never used a global field before and am obviously missing something fundamental. I would very much appreciate it if you can please point me in the right direction. Thanks. Roger

                  • 6. Re: Drop down list
                    bigtom

                    You may need to be very clear about what you actually trying to do. Your initial question was answered but then you added something about filtering.

                     

                    Now you are adding a requirement for multiple filters?

                    • 7. Re: Drop down list
                      rawsoft

                      My apologies if I have not made myself clear. I find these things difficult to explain.

                       

                      To keep it simple, assume that I have a database with 2 tables. Table A is the main table and Table B is linked by a foreign key. Assume that field 2 in Table A holds the description of an item.  I want to create a drop down list which will enable me to select an item from a field in Table B and then find all records where field 2 in Table A Is the same as the text in the field in Table B. The field in the Table B drop down list will only contain the text needed for the various items that I need to select (There are about 40) When that item has been selected, I want it to display a layout which only shows records that match the contents of the two fields (which will be the same).

                       

                      I hope this makes sense. Thank you for your patience.

                      • 8. Re: Drop down list
                        bigtom

                        Is TableA::field2 an exact match to the text in TableB?

                         

                        Are you trying to match only one selection or multiple?

                         

                        Are you starting on a layout for TableA or B?

                         

                        This is doable but the details depend on what you are dealing with exactly.

                        • 9. Re: Drop down list
                          rawsoft

                          Thank you so much for trying to help. I have re-examined the database and it seems that I have structured it in a way that will make it impossible to achieve what I am looking for. Accordingly, I am looking at completely re-writing the database and importing the data from the existing. I have a clear idea of what I am trying to do but have not explained it very well and will need to complete the re-write before I can take it further. I do not wish to waste your time so I will finish the revised version and create a new post. Thank you very much for your input. Regards. Roger

                          • 10. Re: Drop down list
                            dburnham

                            You could also use Execute SQL to create a virtual list that presents your value list.

                            • 11. Re: Drop down list
                              David Moyer

                              hi,

                              Here is my solution to my assumption of your challenge here:

                              - you do need a global text field to receive the choice from the drop-down list

                              - you will need something like an OnObjectModify trigger to a script that goes to the pertinent layout (the one indicated in the drop-down list and is now in your global text field).

                              - what appears to be missing is a Value list

                                - go to File>Manage>Value Lists and create one

                                - put your global field on a layout and define it as a drop-down menu, via the Inspector, and choose your new value list (also in the Inspector).

                              - now, set your script trigger on that field to run your layout-choosing script

                               

                              I hope this helps, dave

                              • 12. Re: Drop down list
                                rawsoft

                                Thanks Dave

                                I have created a global text field and a value list. I then tested to see if it is possible to search using this drop down list. In normal browse mode, the drop down list works normally but in search mode, the items in the list do not appear. Any ideas?

                                • 13. Re: Drop down list
                                  David Moyer

                                  I just encountered this problem with global container fields in find mode.  I wrote it off to versioning (mine v14, problem in v13).

                                  I tested the solution discussed above, and the list appears and is selectable in find mode.

                                  Double-check that the field is defined to allow entry in find mode.  Are you working in single-user mode?  (It works for me in single-user mode ... I haven't tested it as client/server.)

                                  • 14. Re: Drop down list
                                    bigtom

                                    Needs to be a scripted search. Not a normal manual find. Add a search button.

                                     

                                    Basic script: Go to the correct layout. Enter find mode. Set the search field to the global value and then perform find.

                                     

                                    Another way is to use ExecuteSQL to get the primary keys of the matching records an store them in a global field that is matched to your record key field. Run the script from the global layout table and then use Go To Related Record to see your found set.

                                     

                                    Depending on your deployment and and use of WAN this can be faster.

                                    1 2 Previous Next