6 Replies Latest reply on Mar 11, 2013 3:46 PM by PaulCane

    Drop down menu item as a goto record

    PaulCane

      Title

      Drop down menu item as a goto record

      Post

           Hi, I have a home screen that I want to put a drop down box on, with customer name in, and when you select a customer name, it will take you to that customer record in a customer layout.

           I have the drop down box showing the names, but the scrips I've tried don't work (except one that opens a new record with the selected name as a new customer :( )

            

           Any help would be appreciated

            

           Paul

        • 1. Re: Drop down menu item as a goto record
          philmodjunk

               Make the drop down list field a field with global storage specified for it, then use a script such as those posted as examples here:

          Scripted Find Examples

          • 2. Re: Drop down menu item as a goto record
            PaulCane

                 Thank you for a quick reply, I'm a total newbie to scripting, and had a problem trying to use;

                  

            Go To Layout [Select a layout based on table being searched]
            Enter Find Mode [] ---> clear the pause check box
            Set Field [YourTable::YourField ; Globals::gField]
            Set Error Capture [on] ----> Keeps error dialog from interrupting script when no records are found
            Perform Find []
            If [Not Get ( FoundCount ) // no records were found ]
                Show Custom Dialog ["No records were found by this search."]
            End IF

                  

            but had problems entering  Globals::gField in the Set Field line

            the script thing also objected to the Show Custom Dialog bit......

                  

                  

            Thanks

                  

            Steve

            • 3. Re: Drop down menu item as a goto record
              philmodjunk

                   When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Do not click the specify button next to the repetition box. Click OK to close this dialog box. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.

                   With regards to "objected to" on the show custom dialog step. That doesn't give me anything to go on. Exactly what message did you get? What text, if any was highlighted after the error message appeared?

              • 4. Re: Drop down menu item as a goto record
                PaulCane

                     Yet again thansk fpr the quick reply....it is much appreciated!!

                     I've sorted the "show custome dialog bit, but still have problems with the Set field.

                     I specified the table and field (customer:name) with no problem, but when I go to the second button to enter Global::gField, I get the message "The specified table cannot be found'

                      

                     I have set the field on my home screen to Global, and have re-checked that it is set.

                     The field on my home page, that I am trying to use for the search is called Name, and is a drop down box and is showing data from customer:Name, 

                      

                     Regards

                      

                      

                     Steve

                      

                • 5. Re: Drop down menu item as a goto record
                  philmodjunk

                       Have you created a table named "global" and put your global drop down field into it?

                       You need to replace "global::gField" with a reference to your drop down list field--which must have global storage specified.

                       The example assumes the presence of a globals table. It is not strictly required. Fields that are specified to use global storage may be defined in any table in your file and they will still be accessible from any layout, from any script and in find mode as well as browse and preview modes. For that reason, I put most of my global fields in one table named globals to make them a bit easier to manage.

                  • 6. Re: Drop down menu item as a goto record
                    PaulCane

                         Thank you for your patience, I made a global table, put my field on it, reflected the change in the script and it now works :) I will eventually get the hang of these scripts! 

                          

                         Many, many thanks

                          

                         Steve