4 Replies Latest reply on Aug 21, 2009 7:41 AM by theOtter

    Perform find when layout loads in IWP

    Woofumdust

      Title

      Perform find when layout loads in IWP

      Post

      I have been pulling my hair out trying to figure out how to get a layout to perform a find when loaded when accessed via IWP using File Maker Pro. It works fine running from the desktop.

       

      The load script does not seem to load, as I saw in another post. So I tried to add a layout with button that ran a script that loads the layout, per the advice in the other post. Two things happen, the script which has something like:

       

      Field = Get(AccountName)

       

      puts the text "Get(AccountName)" in the Field and then the form waits for the user to push the Perform Find button.

       

      What I would like is for it to execute the Get and then do the find.

       

      The overall goal is limiting users to seeing records they created, which works fine when running from the desktop. In that case the script runs, the find is performed, and then only the users records show, etc.

       

      If the server version has some extra features to help with this, please point that out too, because long term I will install the server version.

       

      Mike Jones

        • 1. Re: Perform find when layout loads in IWP
          TSGal

          Woofumdust:

           

          Thank you for your post.

           

          In your script, have:

           

          Enter Find Mode []

          Set Field [ <field> ; Get ( AccountName ) ]

          Perform Find []

           

          -----

           

          This enter Find mode, sets the field to the AccountName, and then performs the find.

           

          Please let me know if you need clarification for any of the above steps.

           

          TSGal

          FileMaker, Inc. 

          • 2. Re: Perform find when layout loads in IWP
            Woofumdust
              

            This worked for the normal user interface, but not for the web publishing. Just to test, I put the following in the script:

            Enter Find Mode [Pause]

            When I do this the normal user interface goes into find mode and is ready for input. But the web interface does nothing at all. Yet when I select Web Publishing under Show Compatibility, the command is listed. I turned on and off Instant Web Publishing and that made no difference.

            The permissions on the layout for the logged in user is view only. Scripts are execute only.

            So then I just wanted to see if the script ran or not so I put the following script step:

             

            Set Window Title

             

            Again, this worked for the normal user interface, but not for Instant Web Publishing.

             

            What can prevent the OnLayoutLoad script from running only for Instant Web Publishing when I have enabled execute only for scripts for the logged in user?




            • 3. Re: Perform find when layout loads in IWP
              TSGal

              Woofumdust:

               

              I just created a script that has:

               

              Enter Find Mode [Pause]

               

              I created a button on the layout to execute this script.  In Instant Web Publishing, it takes me directly into Find Mode, and my buttons in the Status area are:

               

              Perform Find

              Extend Found Set

              Constrain Found Set

               

              Continue

              Cancel

               

              Log Out.

               

              Why this isn't working for you, I don't know.

               

              I think the key to this post is your last statement....  That is, "What can prevent the OnLayoutLoad script from running only for Instant Web Publishing..."

               

              In Instant Web Publishing, script triggers do not trigger on user interaction.  They only work if a running script sets off the trigger.  Instead, you may want to place a button on the layout to trigger the script.

               

              TSGal

              FileMaker, Inc. 

              • 4. Re: Perform find when layout loads in IWP
                theOtter
                  

                Woofumdust,

                 

                It sounds to me like you may have an incompatible step in your script. If the script contains any steps that aren’t web-compatible (select “Web” from the pop-up in the lower left corner, and they’ll be grayed out), the entire script will fail.

                 

                The workaround is to put each of your web-incompatible steps in a different script and call that script from the main one. Since Perform Scriptis web-compatible, only the sub-script will fail to run.

                 

                Does that fix it?