Form Button’s use of SweetAlert and Toast

I would like to use SweetAlert and Toast to present PHP button confirmations. Specifically, to replace the “OK” confirmation on the form’s center top. I have used several methods without success and would greatly appreciate some direction.

tried sc_alert in combination with sc_exit(sel/ref)?
[TABLE=“cellpadding: 0, cellspacing: 0”]
[TR]
[TD]sc_exit(Option)[/TD]
[/TR]
[TR]
[TD] [TABLE]
[TR]
[TD]This macro can be used in the ScriptCase events and created button and may return values/process after the execution. [TABLE=“border: 0”]
[TR]
[TD=“width: 15%, align: left”]Option[/TD]
[TD=“align: left”]Description[/TD]
[/TR]
[TR]
[TD=“align: left”]sc_exit()[/TD]
[TD=“align: left”]Returns to the previous application without display anything.[/TD]
[/TR]
[TR]
[TD=“align: left”]sc_exit(ok)[/TD]
[TD=“align: left”]Displays a window with an OK button adn returns to the previous application.[/TD]
[/TR]
[TR]
[TD=“align: left”]sc_exit(sel)[/TD]
[TD=“align: left”]Doesn’t display the window with an OK button and returns to the current application, repeat the application select.[/TD]
[/TR]
[TR]
[TD=“align: left”]sc_exit(ref)[/TD]
[TD=“align: left”]Doesn’t display the window with an OK button refresh data and returns to the current application.[/TD]
[/TR]
[TR]
[TD=“align: left”]sc_exit(ok,ref)[/TD]
[TD=“align: left”]Same of the sc_exit(ref) function; however, display the OK button.[/TD]
[/TR]
[TR]
[TD=“align: left”]sc_exit(ok,sel)[/TD]
[TD=“align: left”]Same of the sc_exit(sel) function; however, display the OK button.[/TD]
[/TR]
[/TABLE]

					This option is only valid for Form and Control Applications.

[TABLE=“border: 0”]
[TR]
[TD=“width: 15%, align: left”]Opton[/TD]
[TD=“align: left”]Description[/TD]
[/TR]
[TR]
[TD=“align: left”]sc_exit()[/TD]
[TD=“align: left”]Doesn’t complete transactions in database.[/TD]
[/TR]
[TR]
[TD=“align: left”]sc_exit©[/TD]
[TD=“align: left”]Commit pending transactions.[/TD]
[/TR]
[TR]
[TD=“align: left”]sc_exit®[/TD]
[TD=“align: left”]Rollback pending transactions.[/TD]
[/TR]
[/TABLE]
[/TD]
[/TR]
[/TABLE]

		Macro Scope 			[TABLE="cellpadding: 0, cellspacing: 0"]

[TR]
[TD]calendar application[/TD]
[TD]Form application[/TD]
[TD]Control Form[/TD]
[/TR]
[TR]
[TD=“width: 120px”]onScriptInit[/TD]
[TD=“width: 120px”]onClick
onScriptInit[/TD]
[TD=“width: 120px”]onClick
onScriptInit[/TD]
[/TR]
[/TABLE]
[/TD]
[/TR]
[/TABLE]

I attempted to use the sc_exit options in your message which I wasn’t previously aware of to no avail. The only event the blank form application offers are onExecute and there is no option to create buttons, nor does it include a toolbar, and when called simply opens and runs the onExecute. For reference sake, I adapted to my need what was shown in a recent SC webinar https://youtu.be/NPZ8v20qmmM but just can’t figure out how to gracefully return to the parent form application and still see the alert messages coming from the onExecute.

Is there another part of the solution?

Did you solve this?

The problem is when we use sc_error_exit on php button and in form its activate “use sweetalert”, so then on producction environment when use the php button
there is an “accept” button behind the sweetalert popup window. For users who will use the form or your system will be so annoying becouse need make 2 click to come back the form

just i reported this to sc. I hope they can solve.

If anyone has an alternative solution I would appreciate it

2 Likes

This problem has existed for a long time. It’s amazing that he’s still here. I think I’m going to have to give up scriptcase because of these kinds of details that my boss points out to me too often. (see: Using buttons)