5 Replies Latest reply on Dec 14, 2010 9:58 AM by philmodjunk

    Layout and script compatibility

    cfeinman

      Title

      Layout and script compatibility

      Post

      I am using FileMaker Pro 11. Our company server, where the FM shared database is stored, has FileMaker Pro 11 Advanced. We also use web publishing. I created a layout and related script on my computer and it shows that it is compatible with the client, server, and web publishing. On my computer, the report looks fine. On the web, it shows the basic layout but it lists all records rather than performing the script. On the server, it shows a window that says that no files were found.

      When I look at the layout and script files from the server,  I don't see any problems but it still doesn't work. I am really frustrated. What am I missing?

        • 1. Re: Layout and script compatibility
          philmodjunk

          How is the script triggered? (Script triggers do not work in Instant Web Published databases except for when a script performed by the user trips the triggers.)

          Can you post your script? (With FileMaker Advanced, you can generate a database designreport and copy/paste your script from there. With regular FileMaker you can print your script to a PDF and use the PDF reader's text tool to copy the script for pasting here.)

          Are global fields part of how this script functions? (FileMaker handles global fields differently on a hosted database from how they work on a single user file--so this might be a factor.)

          • 2. Re: Layout and script compatibility
            cfeinman

            I am new to FM so I'm not sure about global fields, but I did not set any up that way.

            The script is triggered OnLayoutEnter.

            Enter Browse Mode
            Go to Layout [ “DP Deliverables” (Line Items) ]
            Constrain Found Set [ Specified Find Requests: Find Records; Criteria: Related Products::Owner: “Susan” ]
            [ Restore ]
            Sort Records [ Specified Sort Order: Proposals::Year; ascending
            Line Items::Month; based on value list: “Month”
            Invoice Billing Customer::Company; ascending
            Line Items::Product Name; ascending ]
            [ Restore; No dialog ]
            #Go to Preview mode for earlier versions which do not support summary reports in Browse mode.
            If [ GetAsNumber ( Substitute ( Get ( ApplicationVersion ); "."; "x" ) ) < 1000 ]
            End If
            Enter Browse Mode
            Go to Layout [ original layout ]

            • 3. Re: Layout and script compatibility
              philmodjunk

              Constrain Found Set looks like the culprit here. Without knowing more about your system, it looks like that step should be a Perform Find Step. Constrain reduces the current found set to only those records that match your criteria. If you current found set has no records that match the criteria, you'll get a "no records found" error dialog. Where this will play differently on a hosted vs a local file is that local files will open with the found set current at the time they were closed. Hosted files will revert to the found set current at the time the file was first opened on the host machine.

              And this script won't trigger at all when you use a web browser to access the file. You'd need this script to run when the file is opened or you will have to attach it to a button that performs this script.

              PS. This last bit of script doesn't actually do anything as written:

              #Go to Preview mode for earlier versions which do not support summary reports in Browse mode.
              If [ GetAsNumber ( Substitute ( Get ( ApplicationVersion ); "."; "x" ) ) < 1000 ]
              End If
              Enter Browse Mode

              • 4. Re: Layout and script compatibility
                cfeinman

                Thank you! That fixed the problem with the server, but the web version still requires Find and Sort. Do I need to change how the script is triggered?

                • 5. Re: Layout and script compatibility
                  philmodjunk

                  Yes, that's why I said this in my last post: 

                  And this script won't trigger at all when you use a web browser to access the file. You'd need this script to run when the file is opened or you will have to attach it to a button that performs this script.