From 5b1545ad391b1631be503ef35678df9707c25ca3 Mon Sep 17 00:00:00 2001 From: Sean McNellis <2292260+seanmcne@users.noreply.github.com> Date: Wed, 7 Jan 2026 10:12:26 -0600 Subject: [PATCH 1/3] Removed all references to azure mobile sdk (#153) --- .../OrgDbOrgSettings/orgDBOrgSettings.html | 241 +----------------- 1 file changed, 4 insertions(+), 237 deletions(-) diff --git a/mspfedyn_/OrgDbOrgSettings/Solution/WebResources/mspfedyn_/OrgDbOrgSettings/orgDBOrgSettings.html b/mspfedyn_/OrgDbOrgSettings/Solution/WebResources/mspfedyn_/OrgDbOrgSettings/orgDBOrgSettings.html index 2d2ad60..43910a5 100644 --- a/mspfedyn_/OrgDbOrgSettings/Solution/WebResources/mspfedyn_/OrgDbOrgSettings/orgDBOrgSettings.html +++ b/mspfedyn_/OrgDbOrgSettings/Solution/WebResources/mspfedyn_/OrgDbOrgSettings/orgDBOrgSettings.html @@ -328,91 +328,12 @@ } return new Error(errorMessage); }, - //following two functions are not used now - updateSolution: function (base64String) { - ///A Base64 Encoded string of a CRM solution zip file - ///Takes in a base64 string and updates the managed solution automatically - var request = [ - '', - '', - '', - '', - '', - '', - 'OverwriteUnmanagedCustomizations', - 'false', - '', - '', - 'PublishWorkflows', - 'false', - '', - '', - 'CustomizationFile', - '', - base64String, - '', - '', - '', - 'ImportJobId', - '00000000-0000-0000-0000-000000000000', - '', - '', - '', - 'ImportSolution', - '', - '', - '', - ''].join(""); - var req = new XMLHttpRequest(); - req.open("POST", (SDK.SOAP.getOrgRootUrl() + "/XRMServices/2011/Organization.svc/web"), true); - //try { req.responseType = 'msxml-document' } catch (e) { } - req.setRequestHeader("Accept", "application/xml, text/xml, */*"); - req.setRequestHeader("Content-Type", "text/xml; charset=utf-8"); - req.setRequestHeader("Content-Length", request.length);//experimental to increase soap message size. - req.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute"); - req.onreadystatechange = function () { - if (req.readyState == 4 /* complete */) { - req.onreadystatechange = null; //Addresses potential memory leak issue with IE8 - if (req.status == 200) { - //Success - var doc = req.responseXML; - alert('we did it!'); - } - else { - alert('there was an error importing the solution update: ' + ((req.responseText) || "no error")); - } - } - }; - req.send(request); - }, - downloadAzureBlob: function (blobId) { - ///blobId - //if (blobId) { - // var query = client.getTable('applicationVersion').select('id', 'SolutionZip').where({ - // id:blobId - // }).take(1).read().done(function (results) { - // //32000 char limit :( -- SDK.SOAP.updateSolution(results[0].SolutionZip); - // //alert(JSON.stringify(results)); - // //var url = "data:application/octet-stream;base64," + results[0].SolutionZip; - // URL.createObjectURL( - // var url = "data:application/octet-stream;charset=utf-8;base64," + results[0].SolutionZip; - // o$('#downloader').prop('href', url); - // //document.location.href = url; - // //return window.open(url); - // }, function (err) { - // alert("Error: " + err); - // }); - //} - }, __namespace: true }; SDK.Settings = { ajaxTimeout: 300000, crmServerDBVersion: new BuildVersion(0,0,0,0), - azureClient: null, daysOfCache: 7, - azureMobileUrl: "https://orgdborgsettings.azure-mobile.net/", - azureMobileKey: "SJJAJKWgJGFTMkJmXsetIytXmxMxqM37", minWindowHeight: 825, OrganizationId: null, OrganizationName: Xrm.Page.context.getOrgUniqueName(), @@ -463,149 +384,7 @@ __namespace: true }; var orgLocalStorage = SDK.Settings.LocalStorage; - function checkAzureMobileForUpdates(forceUpdateCheck) { - ///Checks the CRM Solution version, then fires off checks to azureMobile based on a cached date - ///Forces a check against AzureMobile - if (forceUpdateCheck === null) { - forceUpdateCheck = false; //default to false if not passed - } - if (forceUpdateCheck) { - enableProgressDiv(true); - } - - SDK.SOAP.getCrmSolutionVersion().done(function (results, textStatus, XmlHttpRequest) { - if (results && results.value.length > 0) { - var isManaged = results.value[0].ismanaged; - var version = results.value[0].version; - var versionNumber = results.value[0].versionnumber; - var slnBuildVersion = BuildVersion.parseBuildNumber(version); - var slnModDate = new Date(parseInt(results.value[0].modifiedon.replace("/Date(", "").replace(")/", ""), 10)); - //compare the localStorage lastLoadedBuild# - if it's less than the current SLN version then force a check to make sure we're current - try { - if (orgLocalStorage.contains(orgLocalStorage.slnBuildVerKey)) { - var lastLoadedBuildNum = orgLocalStorage.localStorageValue(orgLocalStorage.slnBuildVerKey);//get value from localstorage - if (lastLoadedBuildNum != "") { - var localStorageBuild = BuildVersion.parseBuildNumber(lastLoadedBuildNum); - if (!localStorageBuild.equals(slnBuildVersion)) { - //if our tracked build# is less than our current build# - then force a check - forceUpdateCheck = true; - localStorage.setItem(orgLocalStorage.slnBuildVerKey, slnBuildVersion.toBuildNumberString()); - } - } - } - else { - //not set yet or doesn't have localstorage - let's check and set it - if (orgLocalStorage.supports_html5_storage()) { - localStorage.setItem(orgLocalStorage.slnBuildVerKey, slnBuildVersion.toBuildNumberString()); - } - } - } catch (e) { }; - if (!isManaged) { - updateBanner("Warning: You are not running the managed solution of the settings editor.\rPlease download and use the managed version.", false, "managedslnmsg"); - } - try { - //using azureMobile for xdr's to read newer versions if the enviornment has internet access: - if ((shouldCheckAzureForUpdates(SDK.Settings.daysOfCache) || forceUpdateCheck) && supportedBrowser && slnBuildVersion) { - clearAutoUpdateCache(false); //dump the cache if we require a check for updates - //we must get the org version *BEFORE* calling into AzureMobile - SDK.SOAP.getCrmOrgDBVersion( - onSuccess = function (serverBuildVersion) { - SDK.Settings.azureClient.getTable('applicationVersion') - .select('VersionNumber', 'DownloadUrl', 'PublishedDate') - .where( - function (dateCompare, majorVersion) { - return (this.PublishedDate <= dateCompare && (this.MinCrmVersion <= majorVersion && this.MaxCrmVersion >= majorVersion)); - }, new Date().toISOString(), serverBuildVersion.major) - .take(1) - .orderByDescending('PublishedDate') - .read() - .done( - function (results) { - //on successful Azure check - localStorage.setItem(orgLocalStorage.cacheKey, Date.now()); - //no results return and wait until next time - if (results.length == 0) { - //reset version alert then - localStorage.removeItem(orgLocalStorage.newVersionAlertKey); - return; - } - var latestAzureSln = BuildVersion.parseBuildNumber(results[0].VersionNumber); - if (latestAzureSln.isGreaterThan(slnBuildVersion)) { - alert("You are not running the latest available version!\rSee the yellow ribbon for a download URL for the latest solution."); - var openerCmd = 'javascript:try { openStdWindow(SDK.SOAP.getOrgRootUrl() + "/tools/solution/import/solutionimportwizard.aspx", "Import", 600,500); } catch ($exception) { console.log("An Error Occurred while trying to launch the import dialog, please import the solution via Settings|Customizations|Solutions instead.") }'; - var message = "Version " + - latestAzureSln.toBuildNumberString() + - " is now available! Download and save the new solution package, then Import it into CRM. Once completed press F5 to reload this page." + - "
If you believe you're reaching this message in error Click here to force another update check."; - updateBanner(message, false, "azureNewVersionMsg"); //alert admin of new version - localStorage.setItem(orgLocalStorage.newVersionAlertKey, message); //set new version in localStroage - } - else { - //we know that we've checked and there is NOT a newer version, if there was we wouldn't be here so time to clear out new version alert - localStorage.removeItem(orgLocalStorage.newVersionAlertKey); - localStorage.setItem(orgLocalStorage.slnBuildVerKey, slnBuildVersion.toBuildNumberString()); - SDK.Settings.OrganizationSettings.clear(); //clear currently stored settings - resetBanner(); //reset the banner - retrieveAndDisplaySettings(); - } - }, - function (error) { - updateBanner("Error in message response from AzureMobile: " + err, false, "azureResponseErrorMsg"); - clearAutoUpdateCache(false); - }); - }, - onError = function (error) { - console.log("Failed to check AzureMobile!"); - alert(error); - }); - } - else if (orgLocalStorage.contains(orgLocalStorage.newVersionAlertKey)) { - //if we already know we need a new version, then we should continue alerting the admin - updateBanner(orgLocalStorage.localStorageValue(orgLocalStorage.newVersionAlertKey), false, "azureNewVersionMsg"); - } - } - catch (e) { - /*this is somewhat experimental - if it fails we want to gracefully fail and queue up another update check*/ - updateBanner("An error was encountered when comparing solution build versions to AzureMobile. Please manually check for updates at the project site.", false, "versionErrorMsg"); - //dumpErrorInBanner(e); - clearAutoUpdateCache(false); - } - } - else { - updateBanner("Unable to find the source OrgDbOrgSettings Solution in your CRM organization.", false, "orgDbOrgSettingsNotFoundMsg"); - } - }).fail(function (jqXHR, textStatus, errorThrown) { - SDK.SOAP.getSoapError(errorThrown); - }).always(function (XMLHttpRequest, status) { - if (forceUpdateCheck) { - enableProgressDiv(false); - } - }) - }; - function shouldCheckAzureForUpdates(minDaysInCache) { - ///Minimum days between checking azure - ///indicates if azure should be checked - if (orgLocalStorage.supports_html5_storage()) { - var lastUpdateDateString = localStorage.getItem(orgLocalStorage.cacheKey); - if (lastUpdateDateString) { - var lastUpdateDate = parseInt(lastUpdateDateString); - if ((Date.now() < (lastUpdateDate + (minDaysInCache * 86400000)))) { - return false; - } - else { - return true; - } - } - else { - //the value doesn't exist so we'll check for updates //localStorage.setItem(orgLocalStorage.cacheKey, Date.now()); - return true; - } - } - return false; - }; - + function BuildVersion(major, minor, build, revision) { ///BuildVersion ///Major Build Number @@ -1240,17 +1019,7 @@ }; o$(document).ready(function () { //functions to run only when the page loads and never again - //try to load AzureMobile, if we fail we'll do it silently - problem here is that we cannot catch the error message from AzureMobile :( - try { - if (supportedBrowser) { - SDK.Settings.azureClient = new WindowsAzure.MobileServiceClient( - SDK.Settings.azureMobileUrl, - SDK.Settings.azureMobileKey); - } - } - catch (e) { - dumpErrorInBanner(e); - } + //IE9 and earlier does not support toISOString - so we'll make our own if it doesn't exist Date.prototype.toISOString = Date.prototype.toISOString || function () { return this.getUTCFullYear() + "-" @@ -1274,13 +1043,11 @@ e.preventDefault(); if (orgLocalStorage.supports_html5_storage()) { clearAutoUpdateCache(true); - try { checkAzureMobileForUpdates(true) } catch (e) { alert("The forced update check has failed with an error" + (e.message || "null")); }; + try { alert("Checking for updates is no longer supported") } catch (e) { alert("Checking for updates is no longer supported" + (e.message || "null")); }; } return false; } }); - //check Azure for newer solution versions - checkAzureMobileForUpdates(false); }); function resetBanner() { @@ -1536,7 +1303,7 @@ function clearAutoUpdateCache(alertUser) { ///show user an alert? if (alertUser) { - alert('Clearing Azure cache date, this will force a check for updates back to AzureMobile.'); + alert('Clearing Azure cache date.'); } localStorage.removeItem(orgLocalStorage.cacheKey); localStorage.removeItem(orgLocalStorage.newVersionAlertKey); From 53b2a3bc1fee6bfec781d8391946cf66ba283b9e Mon Sep 17 00:00:00 2001 From: Sean McNellis <2292260+seanmcne@users.noreply.github.com> Date: Wed, 7 Jan 2026 10:15:56 -0600 Subject: [PATCH 2/3] Removing javascript library reference --- .../mspfedyn_/OrgDbOrgSettings/orgDBOrgSettings.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mspfedyn_/OrgDbOrgSettings/Solution/WebResources/mspfedyn_/OrgDbOrgSettings/orgDBOrgSettings.html b/mspfedyn_/OrgDbOrgSettings/Solution/WebResources/mspfedyn_/OrgDbOrgSettings/orgDBOrgSettings.html index 43910a5..9f41228 100644 --- a/mspfedyn_/OrgDbOrgSettings/Solution/WebResources/mspfedyn_/OrgDbOrgSettings/orgDBOrgSettings.html +++ b/mspfedyn_/OrgDbOrgSettings/Solution/WebResources/mspfedyn_/OrgDbOrgSettings/orgDBOrgSettings.html @@ -6,7 +6,6 @@ Organization Settings Editor -