I have this Ribbon button which enables when 2 records are selected. And clicking on the button will open a new record of another entity and I have also got a OnLoad Jscript for the entity which displays the two Selected Record in 2 lookup fields.
But now I want to hide the button if one or both the opportunity records are closed.
How can I modify the below JScripts. The below JScript is registered as an Action for the buttons Command. Also another Action which retrieves "sdk.rest". One Enable rule to enable button only when 2 records are selected.
function OpenBlankUI(selectedIds) {
var windowOptions = {
openInNewWindow: true
};
var parameters = {};
parameters["new_name"] = "Merge Opportunity";
//debugger;
var opp1OppName = "";
var opp2OppName = "";
var loadForm = false;
//first opportunity
parameters["new_opportunity1"] = selectedIds[0];
////Second Opportunity
parameters["new_opportunity2"] = selectedIds[1];
Xrm.Utility.openEntityForm("new_oppdupe", null, parameters, windowOptions);
}
*This post is locked for comments
I have the same question (0)