Announcements
No record found.
In dynamics crm, I want to get managed solution version in javascript. Is it possible to get that in javascript? If it is possible then please suggest.
*This post is locked for comments
Hi Dinal.
Please can you post some more details about your issue?
Kind regards,
Karsten
Hi Dinal,
You could retrieve the solution entity record filtered by the unique name of the managed solution and get the version of the solution using WebAPI in javascript. There is an entity called solution and it has fields unique name and version.
The link below helps you to retrieve records using Web API in Dynamics CRM.
community.dynamics.com/.../ms-crm-2016-web-api-operations-retrieve-single-or-multiple-records
Hope this helps.
You can call a Retrieve Multiple Web API function on the solution entity, pass the solution name and select the version number attribute from the solution entity.
You can use CRM Rest Builder (by Jason Lattimer) to generate the Web Api code that you need.
Download the solution from gitub:
github.com/.../CRMRESTBuilder
Install and create your query against the solution entity and see the code that you need to use in JavaScript.
Pls modify the below Query and pass the Solution GuId instead of xxxxx & get the details.
/// Get Solution Details///////////////
var req = new XMLHttpRequest();req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.0/solutions(xxxxxxxxxxx)?$select=createdon,friendlyname,ismanaged,_modifiedby_value,solutiontype,uniquename,version", true);req.setRequestHeader("OData-MaxVersion", "4.0");req.setRequestHeader("OData-Version", "4.0");req.setRequestHeader("Accept", "application/json");req.setRequestHeader("Content-Type", "application/json; charset=utf-8");req.setRequestHeader("Prefer", "odata.include-annotations=\"OData.Community.Display.V1.FormattedValue\"");req.onreadystatechange = function () { if (this.readyState === 4) { req.onreadystatechange = null; if (this.status === 200) { var result = JSON.parse(this.response); var createdon = result["createdon"]; var friendlyname = result["friendlyname"]; var ismanaged = result["ismanaged"]; var ismanaged_formatted = result["ismanaged@OData.Community.Display.V1.FormattedValue"]; var _modifiedby_value = result["_modifiedby_value"]; var _modifiedby_value_formatted = result["_modifiedby_value@OData.Community.Display.V1.FormattedValue"]; var solutiontype = result["solutiontype"]; var solutiontype_formatted = result["solutiontype@OData.Community.Display.V1.FormattedValue"]; var uniquename = result["uniquename"]; var version = result["version"]; } else { alert(this.statusText); } }};req.send();
//// End/////
Hope this helps
Try to use the code below.
var req = new XMLHttpRequest(); var managedSolutionDisplayName = "yourManagedSolutionDisplayName" req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.0/solutions?$select=version&$filter=friendlyname eq '" + managedSolutionDisplayName + "'", true); req.setRequestHeader("OData-MaxVersion", "4.0"); req.setRequestHeader("OData-Version", "4.0"); req.setRequestHeader("Accept", "application/json"); req.setRequestHeader("Content-Type", "application/json; charset=utf-8"); req.onreadystatechange = function () { if (this.readyState === 4) { req.onreadystatechange = null; if (this.status === 200) { var result = JSON.parse(this.response); var version = result["version"]; } else { alert(this.statusText); } } }; req.send();
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
JS-09031509-0 3
AS-17030037-0 2
Mark Eckert 2