5 Replies Latest reply on Mar 4, 2014 3:45 PM by philmodjunk

    Use Custom Dialogue to Set global Field

    sccardais

      Title

      Use Custom Dialogue to Set global Field

      Post

           Is it possible to use a Custom Dialogue to Set the value of a global field in a script? I can't figure out how to pass the input from the custom dialogue to the Set Field script step.

           I want to use the Custom Dialogue to create a find request and to set the value of a global field that will appear in the header of a layout to show the value of the search criteria.

           I'm using the global value to display the search because the search field is in a related table. If I insert the related field into this layout (instead of the global), it displays the value of the first related record in the related table, not the search criteria.

        • 1. Re: Use Custom Dialogue to Set global Field
          philmodjunk

               There's a lot of missing details here--such as how your script is performing the find and on what layout.

               Am I correct that you are entering find mode and then using show custom dialog to ask the user for search criteria?

               If so, I suggest staying in Browse mode and specifying the global field as your dialog's input field.

               Then you can enter find mode and use set field to transfer the criteria from the global field to the field in which you want to enter the search criteria in order to set up your find request.

               See this thread for examples of scripts that use global fields in this manner: Scripted Find Examples

          • 2. Re: Use Custom Dialogue to Set global Field
            sccardais

                 Thanks for suggestion but still not working. Screenshot of the script that is not working is attached.  Layout is showing records from table "Surveys" global field "g_find" is in Surveys. Field to search is in related table, "Issues Mentioned". I added field "Issues Mentioned" to the layout but that didn't' fix the problem.

            • 3. Re: Use Custom Dialogue to Set global Field
              philmodjunk
                   

                        Field to search is in related table, "Issues Mentioned"

                   And what results to you expect this find to produce?

                   When you perform a find by specifying criteria in a related table, you tell FileMaker to find the records in the layout's table (Surveys) that have at least one related record (Issues Mentioned) that matches the specified criteria. Once the find is performed, the layout returns to browse mode and the design of your layout controls what you actually see. Any fields from the related table may then show completely different data than that specified as find criteria if there is more than one related record in the related table.

                   If you want to find records in Issues Mentioned that match the specified criteria, it should be performed on a layout based on Issues Mentioned.

              • 4. Re: Use Custom Dialogue to Set global Field
                sccardais

                     Thanks.

                     I want to print a layout showing fields from the Surveys table based on the find from a field in the Join_Issues_Assigned table.

                     The Surveys table contains a Comments field. Join_Issues_Assigned is a join table between Surveys and Issues List. I want to display all of the Comments field in Surveys based on finding "issues" entered by the user in a Custom Dialogue. WIDE open to suggestions!

                     Thanks for your help.

                      

                • 5. Re: Use Custom Dialogue to Set global Field
                  philmodjunk

                       Finding issues assigned records requires performing the find on a layout based on issues assigned.  I suggest performing the find on an Issues Assigned layout that includes the comment layout from Surveys.