Set action on alert dialog ok button

I want to perform some action on alert dialog ok button click. How can I do it?

<action-record name="action-survey-todo" model="">
    <field name="survey_state" expr="eval: 0"/>

Hello @pkdadhaniya
prompt attribute allow you to show a confirmation message for any buttons.
However if you want to show a different message on OK button for onClick event I think you need change something on JS. (I’m not sure if it’s what you need)

Hello @pkdadhaniya, you can use action-validate for this purpose.

<alert message="Some message" if="some condition" action="next action if confirmed"/>
1 « J'aime »

Hi @am-axelor
The alert message work properly however it seems executing the same action for both buttons OR and cancel.
How can I provide abort action on CANCEL click?

@fabiobottan, sorry the doc is incorrect about the alert. The action on alert will be called on [CANCEL] only and pending action of the current action group will be aborted. While on [OK] the group action sequence will continue.

1 « J'aime »

Thanks @am-axelor much more clear now