In my low code app, there is a table which contains a list of services and I have added a button "Destroy" which is configured to launch an automation script to delete the service. It gets executed directly when the button is clicked but I want to have a confirmation like an "Y/N" before its executed.
Also my script is not an interactive script which is why ShowUI method is also not supporting. Is there any equivalent method for a normal automation script? Or any way to directly configure this in LCA rather than in the script?
Please advise.
Hi Harinee,
It is not possible to configure this in the LCA itself. I would suggest creating a IAS script that shows a confirmation dialog to run the script itself. I have created a small example that shows a dialog and runs the desired script "scriptName" when the Ok button is clicked.
namespace ConfirmStartScript
{
using System;
using Skyline.DataMiner.Automation;
using Skyline.DataMiner.Utils.InteractiveAutomationScript.Dialogs;/// <summary>
/// DataMiner Script Class.
/// </summary>
public class Script
{
public void Run(Engine engine)
{
//do not remove this
//".ShowUI("try
{
OkCancelDialog dialog = new OkCancelDialog(engine, "Are you sure you want to execute this script?");
dialog.OkButton.Pressed += (sender, args) => {
var subscriptInfo = engine.PrepareSubScript("scriptName");
subscriptInfo.Synchronous = true;
subscriptInfo.StartScript();
};
dialog.Show();
}
catch (Exception e)
{
engine.ExitFail("Something went wrong: " + e);
}
}
}
}