5 Replies Latest reply on Mar 16, 2009 2:52 PM by philmodjunk

    Setfield on and off the layout

    synergy46

      Title

      Setfield on and off the layout

      Post

      Thanks to some of the great 'guides' on this forum, I now use:

       

      Enter Find Mode()

      set field (Field1; "ouch")

      Perform Find

       

      I have noticed that sometimes that if Field1 isn't on the layout or on the desktop next to the layout, set field doesn't work.  (Yes, it is in the table but not on the layout).  When I add it to the desktop next to the layout, Found works.  But, after that, I can take it off the desktop and it continues to work.

       

      Granted, I was editing a script at the time so a couple of things were going on but "Does anyone know if it is a requirement to have Field1 on or near the layout?

       

      THanks

       

       

        • 1. Re: Setfield on and off the layout
          comment_1
            

          Set Field [] does NOT require the field to be on the layout.

           

          I am not sure what you mean by "the desktop next to the layout".

          • 2. Re: Setfield on and off the layout
            synergy46
              

            RE: Next to the layout.  I guess I should have said "next to the form" on the layout.

             

            Sorry for the confusion and thanks for the input.

             

             

            • 3. Re: Setfield on and off the layout
              philmodjunk
                

              That's still confusing. The field is either on a layout or it's not. In either case, set field will work. I'd check your script and the data type of the field in question. Any chance you are trying to use set field to enter an expression like "3/15/09...3/25/09" into a date field? If so, that's your problem as that won't work in any case.

               

              If you are trying to enter an expression into a date field via script while in find mode, you still have to use "insert text" or "Insert calculated result" and now have a layout sensitive script that won't work unless the field is present on the layout.

               

              Another possibility: make sure you don't have the "restore" option selected in your Perform Find script step. This option will overwrite the values you entered with your Set Field.

               

               

              • 4. Re: Setfield on and off the layout
                comment_1
                  

                PhilModJunk wrote:

                Any chance you are trying to use set field to enter an expression like "3/15/09...3/25/09" into a date field? If so, that's your problem as that won't work in any case.


                It WILL work in version 7 and above.


                • 5. Re: Setfield on and off the layout
                  philmodjunk
                    

                  Thanks comment.

                   

                  I made the jump from 5.5 to 10 and missed that one. I thought I had tested this one and found it still didn't work. However, I just did a quickie experiment and you are correct. Set Field can be used to enter text expressions into a date field when the layout is in find mode. That eliminates one more case of undesirable layout sensitivity in the scripts I've been updating since for the past two months.