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
sai007sai007 

I'm getting undefined value can any one help me with this

{!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')}
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")}
try{
  jQuery(function() {
    jQuery('head').append('<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/start/jquery-ui.css" type="text/css" />');
   var agentName = '{!$User.FirstName}';
   var outboundnum;
   var internalnum = {!$User.Phone};
   var customerName = '{!Contact.Name}';
   var html =
      '<html><head><body><div id="dialog" title="Select Phone Number"><div><p>Contact Name:- {! Contact.Name}</p></div><select class="phone"><option value={! Contact.WorkPhone__c }>{! Contact.WorkPhone__c }</option><option value={! Contact.Phone }>{! Contact.Phone }</option><option value={! Contact.MobilePhone }>{! Contact.MobilePhone }</option></div></body><script>$(document).ready(function(){ $("select.phone").change(function(){outboundnum = $(this).children("option:selected").val();alert(outboundnum);});});</script></head></html>
sai007sai007
if(!jQuery('[id=dialog]').size()){
      jQuery('body').append(html);
    }    

    jQuery( "#dialog" ).dialog({
      autoOpen: true,
      modal: true,
      show: {
        effect: "bounce",
        duration: 1000
      },
     
      buttons: {
        "Continue": function() {
          var initiateCall = confirm("Initiating call from " + agentName + "(" + 
        internalnum + ") to " + customerName + "(" + outboundnum + ") \nAre you sure?");
          if(initiateCall) {
            var id = sforce.apex.execute("ClickToCallController","makeCall",
            {internalnum:internalnum ,
             outboundnum:outboundnum});
          }
          //jQuery( this ).dialog( "close" );
        },
        Cancel: function() {
          jQuery( this ).dialog( "close" );
        }
      }
    });
  });
}
catch(e){
alert('An Error has Occured. Error: ' + e);
}