How to add dialog Yes no button in Runbasebatch form for Confirmation

Hi ,

I have created one RunbaseBatch using class and form. By Opening this class it will call the RunbaseForm.

My requirement is when user click OK button. it should ask confirmation to user who is creating the batch as "Do you want to Proceed ? " How to do the customization in Class which extends RunbaseBatch.

5710.batch.jpg

Hello,

I think you can achieve this by overwriting the ‘prompt’ method and do something like:

public boolean prompt()
{
boolean ret;

ret = super();
if(ret && Box::yesNo(‘Click yes to continue’, DialogButton::Yes, ‘Test’) == DialogButton::Yes)
{
return ret;
}
return false;
}

Kr,

Thanks Dave,

This dialog Box asking confirmation for twice , it should ask only once. this prompt method is calling twice. how to overcome this

if(ret && Box::yesNo(‘Click yes to continue’, DialogButton::Yes, ‘Test’) == DialogButton::Yes)
{
return ret;
}

the above code is not working

only below one is working but it appears twice

if(Box::yesNo(‘Click yes to continue’, DialogButton::Yes, ‘Test’) == DialogButton::Yes)

{
return ret;
}

you can override checkCloseDialog method(this will be called by the closeOk of the dialog form) and can add this prompt there…

The 'ret && ’ part I put there because else the message box will also show when you press the Cancel button.
For that reason, I first let the super() do his job to verify which button is pressed. The ret variable will tell me what button is pressed.

But I suggest to take the approach of Kranthi, that method is probably more suitable.

Kr,

Thanks Kranthi, Its working fine. I have one more doubt. I’m doing Update Process in run method. Once the Updation has completed in batch it should show message to user as "Data has updated " in which place i have to write code.

use try, catch. In try after completing all the operations add an info