Kevin
Posts: 0
Joined: Sun Oct 07, 2012 7:58 pm

Invoke Service on Confirmation custom JavaScript code

I have a delete button on one of my screens. I want when the user clicks it he gets a confirmation pop up.

Then he clicks OK the delete service should be invoked. If he clicks cancel then nothing should happen.

What code should I write on the On Click Event Run custom JavaScript box to achieve this.

So far I have this code: confirm("Are You sure you want to delete?");

Kevin
Posts: 0
Joined: Sun Oct 07, 2012 7:58 pm

Invoke Service on Confirmation custom JavaScript code

Any Help on this one?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Invoke Service on Confirmation custom JavaScript code

What you have is correct:

code
var a = confirm('Are you sure?');
if (a) {
serviceIntanceName.execute({});
}
else {
// do something
}
/code

Kevin
Posts: 0
Joined: Sun Oct 07, 2012 7:58 pm

Invoke Service on Confirmation custom JavaScript code

Thank you so much Max it worked!

Johnny
Posts: 0
Joined: Tue Jul 23, 2013 10:09 am

Invoke Service on Confirmation custom JavaScript code

thank you was also looking for this!

Kurt6863778
Posts: 0
Joined: Sun May 11, 2014 2:15 am

Invoke Service on Confirmation custom JavaScript code

Thanks too Max, I as well was searching for this chhhh thanks!

Shubham Pareta
Posts: 0
Joined: Thu Aug 14, 2014 2:08 am

Invoke Service on Confirmation custom JavaScript code

it says "Uncaught ReferenceError: restService1 is not defined"

Please help asap

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Invoke Service on Confirmation custom JavaScript code

Hello!

Could you clarify where do you get this error?

Shubham Pareta
Posts: 0
Joined: Thu Aug 14, 2014 2:08 am

Invoke Service on Confirmation custom JavaScript code

It worked for me now i think service was not saved accidentally...

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Invoke Service on Confirmation custom JavaScript code

Hi Shubham,

Thank you for the update!
Please let us know if this happens again.

Return to “Issues”