My plan is to add a button on a form (Contact) that opens a new Task window and fills the "regardingobjectid" lookup field. I'm working on CRM2013 fall.
I found an example here:
msdn.microsoft.com/.../gg334375.aspx
Example: Use Xrm.Utility.openEntityForm to Open a New Window
So it works great if I add the button on Account form and open Contact window.
I changed the lines
parameters["parentcustomerid"] = "2878282E-94D6-E111-9B1D-00155D9D700B";
parameters["parentcustomeridname"] = "Contoso";
parameters["parentcustomeridtype"] = "account";
to
parameters["regardingobjectid"] = entityId;
parameters["regardingobjectidname"] = "Jim Glynn (sample)";
parameters["regardingobjectidtype"] = "contact";
and used it my scenario but I got an error message.
I could't find any documentation, just this example.
Any advices?
Here's full function (not working):
function addTask() {
var parameters = {};
var entityId = Xrm.Page.data.entity.getId();
parameters["regardingobjectid"] = entityId;
parameters["regardingobjectidname"] = "Jim Glynn (sample)";
parameters["regardingobjectidtype"] = "contact";
Xrm.Utility.openEntityForm("task", null, parameters);
}