5 Replies Latest reply on Jan 13, 2012 11:17 AM by philmodjunk

    Prevent the passage from one field to another

    RossanoIennarelli

      Title

      Prevent the passage from one field to another

      Post

      Hi,

      I'm using filemaker pro 11 on a windows xp machine.

      I use a control script on validation object, if the field is not accepted by the script, the user must return on that field.

      how can I do this?

      thanks in advance.

        • 1. Re: Prevent the passage from one field to another
          raybaudi

          You'll need the script step:

          Exit Script ( result:0 )

          • 2. Re: Prevent the passage from one field to another
            RossanoIennarelli

            it doesn't work, if I click the TAB KEY it however change field

            • 3. Re: Prevent the passage from one field to another
              philmodjunk

              Please post your entire script.

              To post a script to the forum:

              1. You can upload a screen shot of your script by using the Upload an Image controls located just below Post A Answer.
              2. You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here.
              3. If You have FileMaker advanced, you can generate a database design report and copy the script as text from there.
              4. If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format. (Use the HTML option on the database tab panel and paste the text into the forum's HTML editor.)
              • 4. Re: Prevent the passage from one field to another
                RossanoIennarelli

                The script is :

                Set Variable [$ FIELD; Value: $ $ FIELD]
                Go to Object [Object Name: $ FIELD]
                If [not isEmpty (get (ContenutoCampoAttivo))]
                Set Error Capture [On]
                Set Variable [$ CONTENT; Value: Get (ContenutoCampoAttivo)]
                Set Variable [$ NUMBER RECORD; Value: Get (NumeroRecord)]
                Go to Layout ["ITEMS" (Article)]
                Perform Find [Requests for specified search: Search records; Criteria: ARTICLES:: CODE: "$CONTENT ="]
                [Reset]
                If [Get (ContoTrovati) = 0]
                Go to Layout ["register" (register)]
                Go to Record / Request / Page [$ NUMBER RECORD]
                [No dialog]
                Go to Object [Object Name: $ FIELD]
                Show Custom Dialog. [Title: "WARNING" message: "WARNING FOR THE 'ARTICLE' & & $FIELD" YOU HAVE PLACED A CODE DOES NOT EXIST "Buttons:" OK "]
                else
                Go to Layout ["register" (register)]
                Go to Record / Request / Page [$ NUMBER RECORD]
                [No dialog]
                end If
                If [$ field = "KIT"]
                Go to the [log:: KIT]
                [Select / perform]
                Exit Script [Result: 0]
                end If
                If [$ field = "CENTRAL WHEEL"]
                Go to the [log:: CENTRAL WHEEL]
                [Select / perform]
                Exit Script [Result: 0]
                end If
                If [$ field = "Tree"]
                Go to the [log:: TREE]
                [Select / perform]
                Exit Script [Result: 0]
                end If


                translation by google translate.

                • 5. Re: Prevent the passage from one field to another
                  philmodjunk

                  That didn't translage perfectly. I think you have this script:

                  Set Variable [$FIELD; Value: $$FIELD]
                  Go to Object [Object Name: $FIELD]
                  If [not isEmpty (get (ActiveFieldContents ))]
                      Set Error Capture [On]
                      Set Variable [$CONTENT; Value: Get ( ActiveFieldContents )]
                      Set Variable [$NUMBER RECORD; Value: Get ( RecordNumber )]
                      Go to Layout ["ITEMS" (Article)]
                      Perform Find [Requests for specified search: Search records; Criteria: ARTICLES:: CODE: "$CONTENT ="][Reset]
                      If [Get ( ErrorCode ) = 0]
                          Go to Layout ["register" (register)]
                          Go to Record / Request / Page [$NUMBER RECORD] [No dialog]
                          Go to Object [Object Name: $FIELD]
                          Show Custom Dialog. [Title: "WARNING" message: "WARNING FOR THE 'ARTICLE' & & $FIELD" YOU HAVE PLACED A CODE DOES NOT EXIST "Buttons:" OK "]
                      else
                          Go to Layout ["register" (register)]
                          Go to Record / Request / Page [$NUMBERRECORD][No dialog]
                      end If
                      If [$field = "KIT"]
                          Go to field [log:: KIT][Select / perform]
                          Exit Script [Result: 0]
                      end If
                      If [$field = "CENTRAL WHEEL"]
                          Go to field [log:: CENTRAL WHEEL][Select / perform]
                          Exit Script [Result: 0]
                      end If
                      If [$field = "Tree"]
                          Go to Field [log:: TREE][Select / perform]
                          Exit Script [Result: 0]
                      end If

                  What layout is "current" when this script is performed? Register?

                  How does the global variable $$Field get a value? What value is this? the object name of the field?

                  Exactly how does this script fail for you?