Passing lookup and partylist to Xrm.Utility.openEntityForm RRS feed

  • Question

  • Hi Experts,

    I am trying to pass the lookup and partylist field values to the email form, when I click on the ribbon button of custom entity will open the email form with prepopulated values of lookup (custom entity record) and party list of the custom entity.

    I am able to populate text fields like "subject".. but not lookup and partylist. below is the code snippet.

    It would be great if you can help on this.

    function OpenEmail() {
        var parameters = {};
        parameters["subject"] = Xrm.Page.getAttribute("subject").getValue();
        var guid = Xrm.Page.data.entity.getId();

        parameters["new_customentityid"] = guid.substr(1, 36);
        parameters["new_customentityname"] = Xrm.Page.getAttribute("subject").getValue();
        parameters["new_customentityidtype"] = "opsim_meeting";

         alert(guid.substr(1, 36));
        var party = Xrm.Page.getAttribute("requiredattendees");
        var partyList = party.getValue();
        var partlist = new Array();
        for (var idx = 0; idx < partyList.length; ++idx) {

            partlist[idx] = new Object();
            partlist[idx].id = partyList[idx].id;
            partlist[idx].name = partyList[idx].name;
            partlist[idx].type = partyList[idx].type;
        parameters["to"] = partlist;
        Xrm.Utility.openEntityForm("email", null, parameters);



    Thursday, December 1, 2016 9:44 PM

All replies