4 Replies Latest reply on Aug 9, 2010 8:44 AM by tony24601

    Running script "on commit" in IWP

    tony24601

      Title

      Running script "on commit" in IWP

      Post

      Hello, I just have a quick question that I couldn't find the answer to. I need to run a script every time a record is commited in IWP. I know this is really easy to do in FM, but I'm having trouble coming up with a way to do it with IWP. My orignal idea was to just add another commit button of my own into the layout and then have the button run my scrips and commit the record. Unfortunately, my client doesn't like this since he's afraid of people still hitting the normal submit record button built into the interface. Any ideas?

      And one more quick question while I'm at it. Is there a way to build into an if statement if(using IWP)? I have one or two scripts that I want to run only in Filemaker and not in IWP since they don't work correctly in IWP and have made workarounds for them.

      I'm using FM Advanced 11, just FYI.

      Thank you.

      -Tony

        • 1. Re: Running script "on commit" in IWP
          philmodjunk

          Question 1: You can hide and lock the status area so that your users don't see two different "commit" buttons. This may require you to create and script a few other buttons so that they don't loose any other functions they need from this area.

          Qustion 2: You can use Get ( ApplicationVersion ) to test to see if the current user is a web client. You can find more about it in Filemaker Help.

          • 2. Re: Running script "on commit" in IWP
            tony24601

            Hmm, the problem with 1 is that they'd need to be able to use that area (for navigation and whatnot) right before and right after they are entering data. So even then, I'd need to have a "On record enter" script to hide the bar when they start entering data. True that I could link the "show" step to the commit button I already have. Is there any workaround for hiding that area automatically when data is starts being entered. I'm pretty sure the client won't be happy with a button that they have to press when they start entering things since they'd be able to get around it.

            2 sounds great, thanks.

            • 3. Re: Running script "on commit" in IWP
              philmodjunk

              Due to the fact that your users are using a web browser, IWP doesn't support script triggers except for those triggered by other scripts. (An onlayoutLoad trigger will fire when another script changes to that layout, for example.)

              It's often best to hide the status area and keep it hidden. If you choose to hide the status area as many developers do, you then add more controls to your layout proper that replace the functions of the controls in your status area so that your users can still do what they need to do. That produces a consistent interface for your users and also frees up some space you can use in your layout design.

              • 4. Re: Running script "on commit" in IWP
                tony24601

                Thanks, I'll have to figure out what he wants me to do.