Spotifre Message Dialog Action

I have a report where when the user clicks on the SAVE button, it runs a script. Can I make a dialog where, as soon as the user types SAVE, a dialog pops up that says β€œConfirm Save ... Yes? No?” And when the user clicks β€œYes,” he runs the script? I would like this to work on both web player and desktop

+3


source to share


1 answer


To solve this problem, you can use the following python script iron:



import clr
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import MessageBox, MessageBoxButtons
from System.Windows.Forms import DialogResult

dialogResult = MessageBox.Show("Some question", "Some Title", MessageBoxButtons.YesNo)
if(dialogResult == DialogResult.Yes):
    MessageBox.Show("The answer is YES")
else:
    MessageBox.Show("The answer is NO")

      

+2


source







All Articles