Page 1 of 3

Invoke Service on Confirmation custom JavaScript code

Posted: Sun Oct 07, 2012 8:12 pm
by Kevin

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?");


Invoke Service on Confirmation custom JavaScript code

Posted: Mon Oct 08, 2012 6:29 pm
by Kevin

Any Help on this one?


Invoke Service on Confirmation custom JavaScript code

Posted: Mon Oct 08, 2012 7:01 pm
by maxkatz

What you have is correct:

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


Invoke Service on Confirmation custom JavaScript code

Posted: Mon Oct 08, 2012 7:15 pm
by Kevin

Thank you so much Max it worked!


Invoke Service on Confirmation custom JavaScript code

Posted: Sat Oct 26, 2013 7:10 am
by Johnny

thank you was also looking for this!


Invoke Service on Confirmation custom JavaScript code

Posted: Thu May 15, 2014 7:39 am
by Kurt6863778

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


Invoke Service on Confirmation custom JavaScript code

Posted: Thu Aug 14, 2014 2:09 am
by Shubham Pareta

it says "Uncaught ReferenceError: restService1 is not defined"

Please help asap


Invoke Service on Confirmation custom JavaScript code

Posted: Thu Aug 14, 2014 2:05 pm
by Maryna Brodina

Hello!

Could you clarify where do you get this error?


Invoke Service on Confirmation custom JavaScript code

Posted: Thu Aug 14, 2014 5:37 pm
by Shubham Pareta

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


Invoke Service on Confirmation custom JavaScript code

Posted: Thu Aug 14, 2014 6:32 pm
by Kateryna Grynko

Hi Shubham,

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