4 Replies Latest reply on Mar 16, 2015 3:52 PM by jdevans

    help needed with navigation in script

    jdevans

      Title

      help needed with navigation in script

      Post

      I have a field that is defined as a date field. I have a script that checks if the user selects Sunday of a given week. If the user selects Sunday, navigation goes to the next field per tab order.

      If not, a message box appears telling the user to select a date that falls on a Sunday.

      Then the script clears their incorrect selection. 

      I would love to know how to get the script to go back to the field, and stay there. Everything I have tried the cursor goes to the next field.

      Here is what I have, that doesn't work...

      Refresh Window [Flush cached join results]
      If [DayOfWeek (GLOBALS::x_week_selected) ≠ 1]
         Show Custom Dialog["Not Sunday"; "Please select a date that falls on a Sunday."]
         Clear [Select; GLOBALS::x_week_selected]
         Go to Field [GLOBALS::x_week_selected]
      End If

         
      Again, I have tried may other versions of this. I tried using Go To Object, and named the x_week_selected field the same as the field name.
      I tried re-arranging the order.

      I tried an Else If statement. I also tried, instead of clearing the field, just going back to it, highlighting the previously selected date. I tried putting my Go To Field step AFTER the End If step. Still doesn't work. Nothing...

      Everything I have tried doesn't put the cursor back in the date field. Instead, it advances to the next field.