function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
HaroldHarold 

Adding a custom dialog on custom home page link

I have created a custom link that sits on the home page.  It's a java script link that kicks off a batch processing job.  What I'd like to do is put in a confirmation dialog to the give the user a chance to back out of running the process.  I can't seem to get the confirm call to work . Here is the code:

{!REQUIRESCRIPT("/soap/ajax/14.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/14.0/apex.js")}
{!REQUIRESCRIPT('//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js')}
{!REQUIRESCRIPT('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js')}
if(Confirm('You are about to update the Opportunities via the batch process. You should make sure no one is modifying Opportunities or Opportunity Splits while this process is running. You can monitor the process under setup/monitoring/apexJobs. Do you want to continue?')sforce.apex.execute("clsOpportunitySplitManageBchbl","processAllManual",{}));


trsmithtrsmith
You have a few syntax issues with that js. Give this a shot:

{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}
if(confirm("You are about to update the Opportunities via the batch process. You should make sure no one is modifying Opportunities or Opportunity Splits while this process is running. You can monitor the process under setup/monitoring/apexJobs. Do you want to continue?")) sforce.apex.execute("clsOpportunitySplitManageBchbl","processAllManual",{});
HaroldHarold
Thanks, that worked.