5 Replies Latest reply on Jul 2, 2012 3:04 PM by RobertBlum

    Insert text script command not working in IWP

    RobertBlum

      Title

      Insert text script command not working in IWP

      Post

      My Filemaker 12 database has a number of buttons which access a simple script with a single Insert Text script line. The contents are simple text and nothing complicated. The buttons work fine when the database is opened with Filemaker Pro but are not working when it is opened with IWP. When using the buttons in IWP, data is sent and transferred to the server but no text is inserted.

      According to the documentation, Insert Text is IWP compatible but it isn't working here.

      The server is a Filemaker Pro 12 Server and the FM Pro Advanced 12 is the working client. These problems existed and did not change from when both were version 11.

      -Rob

        • 1. Re: Insert text script command not working in IWP
          philmodjunk

          What exact options did you use with this insert step?

          Why use Insert Text? Could you use Set Field instead?

          I try to avoid the "insert" script steps when possible as they are more sensitive to the current layout design.

          • 2. Re: Insert text script command not working in IWP
            RobertBlum

            I have only set the text to insert. I want it inserted at the cursor location. In this particular case the buttons are set to work on a portal that may have multiple records. It would be difficult determine which record to insert the text into.

            I suppose that Set Field could be used. Is there a way use Set Field at the current insertion point? Also this text is meant to be added at the end of current text but I suppose this could be solved by copying the current text and appending the new text in the Set Field calculation.

            As a note, I have tried the Insert Text on a filed outside the portal and that didn't work either.

            • 3. Re: Insert text script command not working in IWP
              philmodjunk

              There is an option for Insert Text that inserts text into a specified field or you can leave that option blank and it should insert into a field that has the "focus". I wonder if that second option--which appears to be what you've used here--is web compatible.

              There are get functions that return the selection start and size, and if a field in the portal has the focus, set field on fields in the portal's table will modify that specific record so with some careful construction of your set field's second parameter, it can do the same job as insert text.

              This is one example of using Set Field to append new text to text already present in the field:

              Set Field [YourTable::field ; YourTable::Field & " More text at end" ]

              • 4. Re: Insert text script command not working in IWP
                philmodjunk

                Just found this note in FileMaker Help on Insert Text:

                In a web-published database, use a Commit Record/Request script step after an Insert Text script step to update the record in the browser window.

                • 5. Re: Insert text script command not working in IWP
                  RobertBlum

                  Adding the Commit Record/Request seems to have done the trick. It is annoying that I have to select the field each time I want to insert text (there are a number of insert buttons for common responses) but it is better than not working.

                  -Rob