1 Reply Latest reply on Oct 19, 2010 2:49 PM by philmodjunk

    Cancel and Save buttons



      Cancel and Save buttons



      I have a project where I would like to have two buttons, named <Cancel> and <Save>.

      If the record was just created and the user click <Cancel>, the script would erase that record. If he presses <Save>, it would save the record. I think the best way to do that would be to have a field named <New record?> for example with an auto value of True and have the script check that field. If the user click on <Cancel> and that the field is True, it would erase the record. If he presses on <Save>, the script would change the field value to False, confirming it is not a new record anymore.

      But, in the case where the record already exist (with the <New record?> field set to False, if the user click on <Cancel> I would like the record to revert back to the original info.

      Do you have any suggestions or ideas?



        • 1. Re: Cancel and Save buttons

          Much of what you describe can be accomplished by turning off the auto-save option for the layout in Layout setup...

          Your save and cancel buttons can then use commit record and revert record to save or cancel your latest edits to the record. You can cover the entire background of the layout with an empty web viewer to keep clicking the layout background from triggering a commit record action.

          Reverting a saved record back to a previous value is much more difficult. You'd have to store all the previous values in another record before you could revert back to the previous values.