Hi experts,
I have 2 case form called Apple Case and Samsung Case.
In the account form, I have a dropdown field called new_unit with values Apple and Samsung. Based on the value chosen, the corresponding form opens from the subgrid + button. I customized the command of the button from the ribbon workbench to modify the behavior.
Although the correct form is opening, the fields are not being mapped from account to case. I tried using the parameters["customerid"] = name; method but it doesn't work. Please find my code below and suggest what I can do to map the fields as its very important.
function OpenCase() { var formId = Xrm.Page.ui.formSelector.getCurrentItem().getId(); var unit = Xrm.Page.getAttribute("new_unit").getValue(); var name = Xrm.Page.getAttribute("name").getValue(); alert(name); if(unit == "100000000") { var parameters = {}; parameters["customerid"] = name; parameters["formid"] = "4a63c8d1-6c1e-48ec-9db4-3e6c7155334c"; //replace Form C ID Xrm.Utility.openEntityForm("incident", null, parameters); } else { var parameters = {}; parameters["customerid"] = name; parameters["formid"] = "13d6c837-5edb-4e33-9672-60650f6cf1ef"; // replace Form D ID Xrm.Utility.openEntityForm("incident", null, parameters); } }
Thanks,
Jon
*This post is locked for comments