Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XrmQuery default API version based on CRM Version #300

Open
wants to merge 3 commits into
base: gh_master
Choose a base branch
from

Conversation

Aagaard00
Copy link

@Aagaard00 Aagaard00 commented Jan 11, 2024

Related to issue #245

Changed XrmQuery default API version to be based on CRM Version of the model driven app instead of being hardcoded to 9.2 in the TS "sourcefile" for the XrmQuery JS files

The possible solution i came up with was to replace

const DefaultApiVersion = "9.2";

with

const DefaultApiVersion = Xrm.Utility.getGlobalContext().getVersion().split('.').slice(0, 2).join('.');

In \src\XrmDefinitelyTyped\Resources\dg.xrmquery.web.ts which the xrmQuery files are generated from. In this way the default api version used is decided by the CRM version of the model driven app where the code is run.

Are there any issues with this solution?

Andreas Aagaard Søe Larsen and others added 3 commits January 11, 2024 15:38
…e model driven app instead of being hardcoded to 9.2 in the TS "sourcefile" for the XrmQuery JS files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants