In my Opportunity entity I added a ribbon button that opens a new custom activity form (Minutes of Meeting).
Using JavaScript I want to automatically fill the Regarding field of the new activity pointing to the related Opportunity.
This is my function in the command file:
function openNewForm(){
var parameters = {};
var lookupVal = new Array();
lookupVal[0] = new Object();
lookupVal[0].id = Xrm.Page.data.entity.getId();
lookupVal[0].name = Xrm.Page.getAttribute("name").getValue();
lookupVal[0].entityType = "opportunity";
parameters["regardingobjectid"] = lookupVal;
var windowOptions = {
openInNewWindow: true
};
Xrm.Utility.openEntityForm("adp_minutesofmeeting",null,parameters,windowOptions);
}
When I click on the button, a new windows opens but with no content, not even loading animation.
However if I modify the code and pass null parameters, the new Activity form opens successfully.
Is there anything missing in my code?
*This post is locked for comments
I have the same question (0)