I have created a cancel button to close a form. If you make changes before you click this button, this propmt comes up “Do you want to save your changes?”. Does know a formula or some property change to make this prompt not come up?
Subject: RE: Skip save changes prompt
Try:
FIELD SaveOptions:=“0”;
@Command([FileCloseWindow]);
Subject: RE: Skip save changes prompt
That works; however, someone has suggested to me that idea to me before and they said that this would be the “proper” way to do it (for any command).
@If(@Command([CloseWindow]); “”; null)
Just make sure you have null for your last choice.
Subject: RE: Skip save changes prompt
Actually in my test, that formula only works fine if no field values have changed, but if any values have been edited, you still get the Save prompt. I even tried substituting “” and null just in case that might make a difference (although in the formula language they’re equivalent and interchangeable).
Unless I’m missing something, I don’t see how that formula could be “proper”.
Subject: RE: Skip save changes prompt
Refer to this link.
Bruce said this was the “standard” way to do it; however, I may be mistaking this for not being a different situation.
Subject: RE: Skip save changes prompt
Not only is it a different situation, it wasn’t Bruce who said it, and your formula doesn’t use @Return, which is an important part of the formula you’re trying to imitate.
Subject: RE: Skip save changes prompt
Whoever suggested that to you was dead wrong. This statement:
@If(@Command([CloseWindow]); “”; null)
does nothing different from
@Command([CloseWindow])
Also, null is not any kind of reserved word – like any other made-up word, it returns the value of the field of that name, or “” if there is no such field. So, in most cases it’s the same as “”.
You can use:
@If(@Command([CloseWindow]); “”; @Return(“”))
to attempt a command and discontinue execution if the command fails. However, you would still get the error message or save prompt, which is what you wanted to avoid.
Subject: RE: Skip save changes prompt
Read about SaveOptions field (here and in Designer help).
Subject: Skip save changes prompt
Try creating a field “SAVEOPTIONS” and setting its value to “1” to save or “0” to not save… those are text values, not numbers.
HTH