Confirmation dialog with two buttons which have different actions

I’m walking again into a situation where I want to ask the user if something extra should happen or not. The situation is this:

  1. The user made some changes to a record and wants to save that record.
  2. Tryton see some keys in the values, does some searches and determines that some extra changes are advisable to help the user.
  3. Tryton asks the user to agree with those changes
    a. The user disagree -> Tryton only stores the changed record
    b. The user agree -> Tryton also execute the extra action

You can do that with a wizard but IMO it would be nice to have something like the UserWarning which also returns data when the user disagree so in the backend you can react on that decision.

Any thought on this?

You cannot when you want to save the record the ‘normal’ way in the client.

For me there is nothing generic in your requirements.
I do not think that having such dialog is really an improvement in the user experience because the user may not be able to reproduce the “extra action” later.

When the user is changing a record it is possible that the user, also is going to change underlying records. The “extra action” helps the user to automate the change.

For example, a project employee is removed from a project. The user is asked to remove the employee also from the different project tasks. The user disagree because the project runs a long time and the employee is coming back later.

I would love to have a result like True or False back for the UserWarning instead of raising an Exception. That gives everybody a benefit if they want to use it or not.

This is not a good user experience because if there is a mistake in the choice, it is not possible to “re-do” the action. This use case is clearly better with a wizard.

That is not possible because request are transactionnal.

Basically I don’t care too much if it’s a wizard. But it would be nice to be able to start the wizard automatically after the save action without user intervention. I think that won’t be possible.

You can not launch something when the user click on save. This is again bad user experience because save button is a general button which should have always the same behavior.
Instead you should use a button that launch the wizard which follow your workflow and give the different options.