Hi Guys,

I copied Appointment button and placed on my Custom Entity. Now onclick of Appoinment button i should update appointment record with custom entity values auto filled.

I'm only getting Regarding filled populated (which is Lookup), if i place Regarding in comments then remaining fields are populating.

How to set both 

and below is my code 

function createAppontment()
{
debugger;

var windowOptions = {openInNewWindow: true};


var entityId = Xrm.Page.data.entity.getId().replace("{","").replace("}","");
var entityName = Xrm.Page.getAttribute("new_name").getValue();
var entityType = Xrm.Page.data.entity.getEntityName();

var phone = Xrm.Page.getAttribute("new_phonenumber").getValue();

var parameters = {};

parameters["regardingobjectid"] = entityId;
parameters["regardingobjectidname"] = entityName;
parameters["regardingobjecttypecode"] = entityType;

parameters["new_appointmenttype"] = "100000001";
parameters["new_source"]= "100000000";
parameters["new_phonenumber"] = phone;

Xrm.Utility.openEntityForm("appointment", null,parameters,windowOptions);
}