XrmDefinitelyTyped icon indicating copy to clipboard operation
XrmDefinitelyTyped copied to clipboard

Tool fails on views processing

Open zhaparoff opened this issue 5 years ago • 7 comments

Describe the bug During execution tool fails after the line:

Fetching specific views from CRM...

with error message:

Unable to generate TypeScript files: Argument is out of range. Parameter name: index

To Reproduce Steps to reproduce the behavior:

  1. Config is:
<add key="url" value="https://***.crm4.dynamics.com/XRMServices/2011/Organization.svc" />
<add key="username" value="***" />
<add key="password" value="***" />
<add key="out" value="out/XRM" />
<add key="solutions" value="" />
<add key="entities" value="contact" />
<add key="web" value="out/web" />
<add key="jsLib" value="out/lib" />    
  1. Launch the tool.
  2. Output:

[XrmDefinitelyTyped v.4.3.12] Connecting to CRM...Done! Retrieving CRM version...Done! Figuring out which entities should be included in the context..Done! Creating context for the following entities: - contact Fetching entity names from CRM...Done! Fetching specific entity metadata from CRM...Done! Fetching specific views from CRM... Unable to generate TypeScript files: Argument is out of range. Parameter name: index

Expected behavior No error should be displayed. Files should be generated in the output folder.

Environment

  • CRM/D365/CDS version: 9.1.0.6628 Online (Cyrillic)
  • Tool version: 4.3.12

I've tried a bunch of different entities, including those that have no customizations at all - only OOTB fields: SystemUser, BusinessUnit, etc., but with the same result.

Update I can confirm that it is working fine for version 8.2.8.15, on-premise, english. Not sure, if version or language is the cause.

Update 2 With on-premise, 9.0.6.9, english it works fine as well. But still unsure if it is caused by language.

zhaparoff avatar Jul 27 '19 07:07 zhaparoff

I would guess it is an issue with the language. However, we don't have an instance with Cyrillic alphabet we can test on. Will keep the issue open for now.

TomMalow avatar Aug 16 '19 16:08 TomMalow

I encountered this issue yesterday, and I am only using English. So, this must caused by something else. But, I do have lot of first party apps installed.

rajyraman avatar Oct 02 '19 18:10 rajyraman

I found what the issue is. There was a view without a name (not sure how this is possible), and when I fixed that up the generation was successful. Maybe check whether this is the same for you as well @zhaparoff

rajyraman avatar Oct 02 '19 22:10 rajyraman

@rajyraman Great find, just encountered the same issue and yes, it was a view with a blank name, god only knows how that found it's way into my solution!

mrmwink avatar Dec 17 '19 09:12 mrmwink

I have encountered the issue as well.

Our test environment had a view without a name. The same view in the development environment did have a name, in the interface. However, exporting the solution looking at the xml file. I found that the same view in xml file showed that the <savedquery> element not have a<LocalizedNames> child-element. Deploying the solution to a new environment resulted in the view having no name.

Publish all did not resolve the issue. I had to change the name in other for the solution to recognize that the view had a name.

TomMalow avatar Mar 31 '20 13:03 TomMalow

@magesoe I suggest that we improve the error handling on this issue since it is a recurring bug in CRM. And it will help with a better error message than "index out of range". Maybe something like: "View found without name in the metadata on <Entity> entity."

TomMalow avatar Apr 01 '20 13:04 TomMalow

Definitely, if you have cyrillic names of your views, it will fail. There is a regex in code removing all symbols except latin letters and underscore, so, obviously, cyrillic name will become empty after that.

kirillkanyukov avatar May 05 '23 08:05 kirillkanyukov