
While any operation is performed by the user, there are cases such as need to receive confirmation from the user to perform the operation. In these cases we can use “DialogButton” for user interaction not say “Yes/No” to perform the operation.
Below is an example code
public void clicked()
{
DialogButton diagBut;
str strMessage = 'By clicking OK you confirm to save data into form, do you still want to continue?';
str strTitle = 'My Title';
diagBut = Box::yesNo(strMessage, DialogButton::No, strTitle);
if (diagBut == DialogButton::No)
{
info('Operation canceled');
}
else if(diagBut == DialogButton::Yes)
{
Info('button click code here');
}
}