
var AppCommon;
(function (AppCommon) {
var CommandActions = (function () {
function CommandActions() { }
/*
* The below function launches the PDF dialog with a preselected template
*/
CommandActions.LaunchPDFDialog = function () {
var dialogOptions = {
width: 1090,
height: 625,
position: 1 /* center */
};
var dialogParams = {};
var entityReference = Xrm.Page.data.entity.getEntityReference();
dialogParams["param_entityId"] = entityReference.id;
dialogParams["param_entityType"] = entityReference.entityType;
dialogParams["param_entityTypeCode"] = Xrm.Internal.getEntityCode(entityReference.entityType);
dialogParams["param_templateType"] = 2; // Word document enum code
dialogParams["param_documentType"] = "pdf";
Xrm.Navigation.openDialog("ShowPDFPreview", dialogOptions, dialogParams);
};
return CommandActions;
}());
AppCommon.CommandActions = CommandActions;
// Ribbon Rules for enabling/disabling the PDF button
var RibbonRules = (function () {
function RibbonRules() { }
RibbonRules.isPdfCommandEnabled = function (entity) {
return __awaiter(this, void 0, void 0, function () {
var isPdfSettingEnabled, data, settingObject, settingValue, err_1;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 3, , 4]);
isPdfSettingEnabled = sessionStorage.getItem(entity + "_isPdfSettingEnabled");
if (isPdfSettingEnabled) {