RE: Unable to Copy the Selected record from Ribbon Button
Hi Goutam,
Thanks for your answer. I have followed your mentioned steps, but I am facing 1 issue.
After clicking on the button new form opens but while saving effects goes to the selected record but as per my requirement I wanted to copy the previous record and after saving it will creates a new record.
Now it is modifying the existing record after saving the newly opened record.
Please find below my code:
function run(selectedItems)
{
debugger;
var selectedItem = selectedItems[0];
var incidentId = selectedItem.Id;
var entityFormOptions = {};
entityFormOptions["entityName"] = "contact";
entityFormOptions["entityId"] = incidentId;
entityFormOptions["openInNewWindow"] = true;
var Parameters ={"new_sourcefield" : incidentid};
var formParameters = {};
Xrm.Navigation.openForm(entityFormOptions,Parameters).then(
function (success) {
console.log(success);
},
function (error) {
console.log(error);
});
}
Can you please check that where I am doing the mistake.
At present it is only create new form but after saving no new record creates and the modified effect implements on the selected record only.
Thanks in advance.