You need to sign in to do that
Don't have an account?
sai007
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>
{!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>
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);
}