@aappddeevv/dynamics-client-ui
Version:
## What is it? A library to help you create great dynamics applications.
47 lines • 2.07 kB
JavaScript
;
/** Compatibility module between versions. */
Object.defineProperty(exports, "__esModule", { value: true });
const BuildSettings_1 = require("BuildSettings");
/** Open an entity form. */
function openForm(xrm, entityName, entityId, parameters, windowParameters) {
if (BuildSettings_1.CLIENT !== "UNIFIED") {
xrm.Utility.openEntityForm(entityName, entityId, parameters, windowParameters);
}
else {
const r = parameters;
const n = windowParameters;
const i = {
entityName: entityName,
entityId: entityId,
formId: r && r.formid ? r.formid : void 0,
navbar: r && r.navbar ? r.navbar : void 0,
cmdbar: !(!r || "true" !== r.cmdbar),
width: n && n.width ? n.width : void 0,
height: n && n.height ? n.height : void 0,
openInNewWindow: !(!n || !n.openInNewWindow) && n.openInNewWindow
};
xrm.Navigation.openForm(i, parameters);
}
}
exports.openForm = openForm;
/** Example:
https://blah.crm.dynamics.com/main.aspx?appid=7a590878-c6aa-e711-a94e-000d3a328ed9&pagetype=entityrecord&etn=contact&id=41e03838-e8a9-e711-a94e-000d3a328ed9&formid=af9e8c09-73d6-4e97-9704-6dea31cb3446
**/
/** Open a form using window.open() method. */
function openFormUsingWindow(entityName, entityId, parameters) {
const args = {
pagetype: "entityrecord",
id: `{${entityId}}`,
etn: entityName,
navbar: "on",
cmdbar: "on",
};
// removed toolbar and location to force into the same window (as a tab) vs new window
//const features = "menubar=yes,scrollbar=yes,resizable=yes,status=no,height=1000,width=1000"
const features = "";
// if add extraqs, don't forget to use encodeURIComponent(...) on them, separated by '&'
window.open(`/main.aspx?etn=${entityName}&pagetype=entityrecord&id=${entityId}`, "_blank", features, false);
}
exports.openFormUsingWindow = openFormUsingWindow;
// appid=7a590878-c6aa-e711-a94e-000d3a328ed9
//# sourceMappingURL=Compatibility.js.map