AnsweredAssumed Answered

Custom Dialogue only accepts input via default button

Question asked by Sorbsbuster on May 12, 2011
Latest reply on May 12, 2011 by Sorbsbuster

Title

Custom Dialogue only accepts input via default button

Post

I want to allow the user to select the number of days to search back, and to specify which table they want to search in.  To do this I have offered a custom dialogue with one input field - the number of days back to search.  The 3 buttons are basically 'Search in Table 1', 'Search in Table 2', and 'Cancel'.  The input field is a global number field.  I default it to '14' and allow the user to overwrite that value.

The problem is that the over-written value is only accepted when the Default Button is selected.  For example, this simple script will return the overwritten value when the default button is selected, but will only return 14 when either of the other two buttons are selected.

- Enter Browse Mode
- Set Field (gNumber ; 14 )
- Show Custom Dialogue ("Choose a number" ; "What number do you want to use?" ; gNumber )
- Set Variable ($NumberToShow ; gNumber )
- Show Custom Dialogue ("The number you entered..." ; "The number you entered was: " & $NumberToShow )

(Displaying via a $Variable is neither here nor there - showing the gNumber field in the last dialogue shows the same result.)

My original script is obviously more complex, checking which button was selected to see which table to go to, but the value is collected right at this start of the script.  The result seems really unintuitive.

I have tried 'Commit Record' after most steps.  I have including a redundant set of 'If' steps, to set the variable if the Get ( LastMessageChoice ) is 1, or 2, or 3, but this makes no difference.  The overwritten value is only ever processed from the default button.

Any ideas, please?  I don't really want to break it into two steps - asking first for the days' history, and then a second dialogue asking 'Which report?'

Outcomes