I am Building a test solution, to test I aim to create a duplicate template of an Account on click of button, plugin then fires to include the copy of all the contacts related.
I am currently doing something Similar to this post
However: Here is the bit of code...
function CopyAccount() {
//Collect values from the existing CRM form that you want to default onto your new record
var GUIDvalue = Xrm.Page.data.entity.getId();
var Namevalue = Xrm.Page.getAttribute("name").getValue();
if (GUIDvalue != null && Namevalue != null)
{ var parameters = {};
parameters["new_templateid"] = GUIDvalue;
parameters["name"] = Namevalue;
Xrm.Utility.openEntityForm("account", null, parameters);
}
I Get an Error: SCRIPT5022: id must not be null.
Comes from global.ashx?ver=-1477464416, line 6 character 372572
Xrm.Utility.openEntityForm=function(name,id,parameters){
if(IsNull(name)) trow Error.create("name must not be null.");
if(IsNull(id)) throw Error.create("id must not be null.");
if(IsNull(parameters)) throw Error.create("parameters must not be null.")
Any Ideas?