Identify deprecated JS code in your Power Platform solution using Solution Checker

Recently, you must’ve received an intimation from Microsoft saying that ODATA v2 is now deprecated. See this link: https://powerapps.microsoft.com/en-us/blog/odata-v2-0-service-removal-date-announcement/

And if you are wondering how to go about finding what has been used, you can use Solution Checker to identify deprecated code which should show up like below using your Solution Checker.

Let’s see how we can use Solution Checker!

Running Solution Checker

Here’s how you can run Solution Checker in Power Apps Maker Portal (https://make.powerapps.com/) and see the results –

  1. Given that your solution already contains the JS Web Resources which you want to run Solution Checker on, you can select the Solution and expand Solution Checker to click Run as shown below.

  2. It takes a few moments to Run the Solution Checker solution. You’ll see the spinner as shown below.

  3. Once completed, you can expand the Solution checker and click on View Results.

  4. Once you click on View Results, you’ll see the list of detected anomalies in your JS Web Resources.
    Apart from the suggested JS best practices, you can see the Category Upgrade Readiness to identify the deprecated code being used in your solutions.

  5. Once you click on the Reference link in each of these results, it’ll open up a Pane on the right hand side to show what the issue is

  6. And when you click on Get the complete guide, here’s the link of the same (https://learn.microsoft.com/en-gb/power-apps/maker/data-platform/powerapps-checker/rules/web/avoid-2011-api?WT.mc_id=DX-MVP-5003911) which will give you the below details in Microsoft Learn Documentation –

  7. Now, if you look at the code that is being references in the Solution Checker result, you’ll see the old code (marked with Red Box)being used.
    Instead, you should use the new code (marked with Green Box) to do carry out the newer version of the functionality –

  8. See the next section in this blog to get the details on the deprecation in client side scripting for Power Platform / Dynamics 365 CRM.

Important Deprecations for Power Apps & Power Automate

Here’ are the Deprecated APIs for Power Platform / Dynamics 365 CRM Client Scripting: https://learn.microsoft.com/en-us/power-platform/important-changes-coming#some-client-apis-are-deprecated?WT.mc_id=DX-MVP-5003911

Hope this helps!

Here are some Power Automate posts you want to check out –

  1. Select the item based on a key value using Filter Array in Power Automate
  2. Select values from an array using Select action in a Power Automate Flow
  3. Blocking Attachment Extensions in Dynamics 365 CRM
  4. Upgrade Dataverse for Teams Environment to Dataverse Environment
  5. Showing Sandbox or Non Production Apps in Power App mobile app
  6. Create a Power Apps Per User Plan Trial | Dataverse environment
  7. Install On-Premise Gateway from Power Automate or Power Apps | Power Platform
  8. Co-presence in Power Automate | Multiple users working on a Flow
  9. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  10. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  11. Call a Flow from Canvas Power App and get back response | Power Platform
  12. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  13. Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
  14. Asynchronous HTTP Response from a Flow | Power Automate
  15. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  16. Converting JSON to XML and XML to JSON in a Flow | Power Automate
Advertisement

Find deprecated JS code used in your Dynamics 365 environment | Dynamics 365 v9 JS Validator tool | XrmToolBox

In this point in time where all developers are busy upgrading their Dynamics 365 JavaScript libraries to use the latest supported code.

Here’s an extremely handy tool by Michel Gueli (https://twitter.com/MichelGueli) called as ‘XrmToolBox.Dynamics365V9JavascriptValidator’

Dynamics 365 v9 JavaScript Validator in XrmToolBox

If you use XrmToolBox already, make sure you look for the below tool

  1. In Tool Library, search for Dynamics 365 JavaScript Validator and you’ll find this tool already.

  2. Once you find it, it’s pretty easy to use it.
    You’ll find it in the list of your tools as below



    Then, it’ll just Retrieve all the Resources first. This will take a minute or two depending on your environment.

  3. Once done, it’s best practice to already add all the code you want to analyze in 1 solution in your Dynamics 365 environment like so

  4. Now, in the tool , open the same solution so that you only focus on the JS files you need to work with.

  5. Once you open it up, you’ll find all you files listed below. Just double click one of them and you’ll find what all needs to be changed.

  6. Once you work your way up in the file by replacing the deprecated code, you can reload the solution again and find that there are no longer any warnings like on my other file below

NuGet Gallery Link: https://www.nuget.org/packages/XrmToolBox.Dynamics365V9JavascriptValidator/

Hope this was useful!!
In case you are looking for more XrmToolBox or Dynamics 365 related posts, please check below –

  1. Set Lookups in Xrm.WebApi D365 v9 correctly. Solving ‘Undeclared Property’ error
  2. Find Created On date of solution components in Solution Layers | Dynamics 365 [Quick Tip]
  3. Pass data to HTML Web Resource using browser’s sessionStorage in Dynamics 365 CE
  4. Pass Execution Context to JS Script function as a parameter from a Ribbon button in Dynamics 365 | Ribbon Workbench
  5. Get GUID of the current View in Dynamics 365 CRM JS from ribbon button | Ribbon Workbench
  6. Import lookup referencing records together in Dynamics 365 CRM | [Linking related entity data during Excel Import]
  7. Mailbox Alerts Hide/Show behavior in Dynamics 365 CRM
  8. Enable/Disable the need to Approve Email for Mailboxes in Dynamics 365 CRM CE
  9. Debug Ribbon button customization using Command Checker in Dynamics 365 CE Unified Interface
  10. Get Dynamics 365 field metadata in a Canvas App using DataSourceInfo function | Common Data Service

Thank you!!