Skip to main content
Known Participant
October 15, 2024
Question

Cancel button in app.execMenuItem("SaveAs")

  • October 15, 2024
  • 1 reply
  • 585 views

Hi my name is Alan,

 

I am creating a form with a save feature which is below,

 

app.execMenuItem("SaveAs");

 

I am wondering is there a way to tell if Save or Cancel is click in the dislog box.

 

As I would like to process the next stage of the form based on either button.

 

Thanks,

 

Alan

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
October 15, 2024

Not directly. However, you can know if the file has been saved after the dialog is closed, by checking the "dirty" property. If false, it means the file has been saved (or at least, that it wasn't edited after the last time it was saved). If true, it means it still needs saving (so most likely the user clicked Cancel in the Save As dialog).

alan_9073Author
Known Participant
October 15, 2024

Hi try67,

 

Thank you for the faster reply.

 

Howe would i check the as you call it "dirty" property.

 

Sorry if this is a stupid question.

 

Thanks,

 

Alan

alan_9073Author
Known Participant
October 15, 2024

Would i be correct with the following:

 

if (this.dirty) app.alert("File Not saved");

else {

    

}