debugger;
try {
var entityFormOptions = {};
entityFormOptions["entityName"] = "appointment";
entityFormOptions["useQuickCreateForm"] = true;
formParameters["subject"] = Xrm.Page.data.entity.attributes.get("subject").getValue();
formParameters["regardingobjectid"] = Xrm.Page.data.entity.attributes.get("regardingobjectid").getValue()[0].id;
formParameters["regardingobjectname"] = Xrm.Page.data.entity.attributes.get("regardingobjectid").getValue()[0].name;
formParameters["regardingobjecttype"] = Xrm.Page.data.entity.attributes.get("regardingobjectid").getValue()[0].entityType;
Xrm.Navigation.openForm(entityFormOptions, formParameters).then(
function (success) {
//alert(success);
},
function (error) {
//alert(error);
});
catch (err) {
alert(err.message);
}