Skip to content

Dave Helgerson

Salesforce Software Development and Consulting

Menu
  • Contact
  • Resume
Menu

Alert with Option Buttons in the Window Body – jQueryUI in a Salesforce Custom Button

November 5, 2016February 12, 2017

Here is another example of using jQueryUI in a Salesforce custom button. I’m referencing Super Clone Pro pages that use different configurations for cloning in this example. This could easily be adapted for other pages or actions. Enjoy!

jqueryui-modal-dialog-with-option-buttons

{!REQUIRESCRIPT('//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js')} 
{!REQUIRESCRIPT('//ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js')} 
 
var $j = jQuery.noConflict(); 
$j(function() {
      var winHead = '' +
                    '';
      var winBody = '
' + '

Clone this Rate/Benefit Worksheet Request on this opportunity.

' + '

Clone Opportunity with Single Plan

' + '

Cloned Opportunities can create a new plan from the source Opportunity

' + '

Copy Plan 1 from Source Opportunity

' + '

Copy Plan 2 from Source Opportunity

' + '

Copy Plan 3 from Source Opportunity

' + '

Create a Plan on a different Opportunity using the Plan on this Opportunity

' + '

Copy Plan 1 to another Opportunity

' + '

Copy Plan 2 to another Opportunity

' + '

Copy Plan 3 to another Opportunity

' + '
'; $j('head').append(winHead); $j('body').append(winBody); $j("#clone-dialog").dialog({ autoOpen: true, modal: true, width: 500, buttons: { "Cancel": function() {$j(this).dialog("close");} } }); $j( "#clone-op" ).button().on( "click", function() { window.location.href = '/apex/lcrm-scp__scpclone?rid={!Account.Id}&cfg=StandardClone'; }); $j( "#copy-from-op1" ).button().on( "click", function() { window.location.href = '/apex/lcrm-scp__scpclone?rid={!Account.Id}&cfg=CloneOpt1'; }); $j( "#copy-from-op2" ).button().on( "click", function() { window.location.href = '/apex/lcrm-scp__scpclone?rid={!Account.Id}&cfg=CloneOpt2'; }); $j( "#copy-from-op3" ).button().on( "click", function() { window.location.href = '/apex/lcrm-scp__scpclone?rid={!Account.Id}&cfg=CloneOpt3'; }); $j( "#copy-to-op1" ).button().on( "click", function() { window.location.href = '/apex/lcrm-scp__scpcopy?rid={!Account.Id}&cfg=CopyOpt1'; }); $j( "#copy-to-op2" ).button().on( "click", function() { window.location.href = '/apex/lcrm-scp__scpcopy?rid={!Account.Id}&cfg=CopyOpt2'; }); $j( "#copy-to-op3" ).button().on( "click", function() { window.location.href = '/apex/lcrm-scp__scpcopy?rid={!Account.Id}&cfg=CopyOpt3'; }); });

Related

Super Clone Pro
© 2023 Dave Helgerson | Powered by Minimalist Blog WordPress Theme
 

Loading Comments...