On click of button using Custom Ribbon call the below function to pass the parameter from current from to Lead form
function ConvertToLead()
{
//Get Values from Phone Call
var subject = Xrm.Page.getAttribute("subject").getValue();
var phone = Xrm.Page.getAttribute("phonenumber").getValue();
var to = Xrm.Page.getAttribute("to").getValue()[0].name;
//Set Values to lead
var parameters = {};
parameters["subject"] = subject;
parameters["mobilephone"] = phone;
parameters["lastname"] = to;
var windowOptions = { openInNewWindow: true };
Xrm.Utility.openEntityForm( "lead" , null , parameters ,windowOptions);
}
function ConvertToLead()
{
//Get Values from Phone Call
var subject = Xrm.Page.getAttribute("subject").getValue();
var phone = Xrm.Page.getAttribute("phonenumber").getValue();
var to = Xrm.Page.getAttribute("to").getValue()[0].name;
//Set Values to lead
var parameters = {};
parameters["subject"] = subject;
parameters["mobilephone"] = phone;
parameters["lastname"] = to;
var windowOptions = { openInNewWindow: true };
Xrm.Utility.openEntityForm( "lead" , null , parameters ,windowOptions);
}
Comments