7 Replies Latest reply on May 22, 2011 5:37 PM by Parag

    "Insert Text" script not working when DB published to web

    Parag

      Title

      "Insert Text" script not working when DB published to web

      Post

      I have implemented a simple Insert Text script and while this works fine on the desktop, it fails to to work on the browser. I've simply published this DB using IWP.

       

      Can anyone reccomend tips on how to troubleshoot scripts that fail to work on the web? I think this maybe a recurring issue.

       

      The Help documentations confirm "Insert Text" is definately compatible on the web.

        • 1. Re: "Insert Text" script not working when DB published to web
          philmodjunk

          Don't know why Insert Text is failing, but if you describe how you are using it maybe someone wil have an explanation for you  and we might also be able to suggest a way to use Set Field to accomplish the same action.

          • 2. Re: "Insert Text" script not working when DB published to web
            Parag

            Thanks Phil, hope this helps:

            I have 2 fields. e.g. DateOfBirth and HelpText.

            1. Created a script to insert text and called it "InsertText", e.g. Insert Text [Select; <table::DateOfBirth>; “Enter your DOB”]

            2. Created a script to clear the text and called it "ClearText", e.g. Replace Field Contents [No Dialog; <table::DateOfBirth>;""]

            3. Set the following script triggers on the DateOfBirth field.

               OnObjectEnter --> "InsertText"
               OnObjectExit  --> "ClearText"

            Unfortunately, my problem has grown slightly. Apart from not working on IWP, it now completely skips the DateOfBirth field and moves on to Helptext field. This happens even after I've disabled Field Entry in Browse Mode and Find Mode from Inspector/Data/Behaviour...

            What I'm weary on is,

            * Repetition.. I've set this to 1.
            * Run with full access privellages.. I've checked thie radio box.








            • 3. Re: "Insert Text" script not working when DB published to web
              philmodjunk

              Insert Text depends on the field being present on the layout in order to work and if the cursor is in this field, it inserts the text at the cursor location.

               

              Use this safer script step instead: Set Field [Table:: DateOfBirth ; "Enter your DOB"]

               

              To clear the field, Replace Field Contents is a dangerous choice as it will modify the contents of the specified field for every field in your found set. In a multi-user environment like you describe, you can also get unpredictable results when another user has one or more of these records open for editing at the same time you run the replace field contents.

               

              Set Field [Table:: DateOfBirth ; "" ]

               

              Would appear to be a much safer choice and modifies only the current record.

               

              Note that script triggers do not work on web published DB's when you access the DB via a browser. The only exception to that is if you perform a script by clicking a button and the script's actions might then trigger such scripts. (By going to a layout, changing mode, entering/exiting a field, etc.).

              • 4. Re: "Insert Text" script not working when DB published to web
                Parag

                Thanks Phil, I've taken your advice and used a button that invokes a Set Field Action when clicked and this works! Both on the desktop and on the browser.

                 

                Do you know if there is a way to invoke a secondary action, e.g. Set Field with blank?

                 

                I'd like for the Help text to clear once the user moves from that field or if not, for the user to be able to clear the field.

                 

                Also, I tried using the carriage return you suggested, e.g. by entering "Line1" & ¶¶ & "Line2" into the calculated result field however this doesn't work.  I get an error which notes "An operator (e.g. +, -, *,...) is expected here".

                 

                Thank you so much for your help so far - I have been searching around of the forums but to no avail. :)

                 

                 

                 

                • 5. Re: "Insert Text" script not working when DB published to web
                  ryan

                   


                  Parag wrote:

                   

                  Also, I tried using the carriage return you suggested, e.g. by entering "Line1" & ¶¶ & "Line2" into the calculated result field however this doesn't work.  I get an error which notes "An operator (e.g. +, -, *,...) is expected here".

                   

                   


                   

                  You need to insert a & between the two ¶ :

                  "Line1" & && "Line2"

                   


                  • 6. Re: "Insert Text" script not working when DB published to web
                    philmodjunk

                    Or you can enclose them in quotes:

                     

                    "Line1" & "¶¶" & "Line2"

                    • 7. Re: "Insert Text" script not working when DB published to web
                      Parag

                      Thanks for your help with this but do you know if there is a way to invoke a secondary action, e.g. Set Field with blank?