AnsweredAssumed Answered

Date Field Modification Prompt

Question asked by abbadonnergal on Feb 13, 2012
Latest reply on Feb 13, 2012 by philmodjunk


Date Field Modification Prompt


I have a global date field (Drop-down calendar object) on a layout that is automatically set to today. I'd like to give the user the option of selecting a previous date, if needed, but in 99% of the cases the user should use today's date. To prevent them from accidentally selecting a previous date (or at least to dissuade them from doing so), I'd like to prompt the user to reconsider changing the date. I wrote the following script for this purpose, but I can't seem to figure out the right procedure to execute it via script trigger:

Show Custom Dialogue [Wait!; "You are about to change the date..."] 

#Default button = Cancel / Button2 = Proceed 

If [Get (LastMessageChoice) = 1]

   Revert Record/Request [No dialogue]


   Exit Script []

End If 

I've tried this script on just about every kind of script trigger on the field (On Object Enter, Modify, Validate, Exit, etc) and needless to say, I can't get it to work. Any advice on how to accomplish this? Ideally it should Show Custom Dialogue when they enter the field and either let them Cancel out of it (not changing the date) or Proceed to change the date. Right now the Drop-down Calendar doesn't even appear. With OnObejectExit and Validate it's taking me to the next field in the tab order.