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

Multi-level expands #67

Closed
io-timeout opened this issue Jun 10, 2020 · 3 comments
Closed

Multi-level expands #67

io-timeout opened this issue Jun 10, 2020 · 3 comments
Assignees

Comments

@io-timeout
Copy link

Firstly, thank you for the great work you have done on this library!

According to the documentation, multi-level expands are not yet implemented. This is true in so far that the Expand type definition does not provide an official way to define them.

I looked into the RequestConverter.convertRequestOptions code and it looked like they may naturally be supported as this code recursively calls RequestConverter.convertRequestOptions when processing the expand options.

I subsequently tested a retrieveMultipleRequest with multi-level expands as follows:

  const result = await dynamicsClient.retrieveMultipleRequest({
    collection: 'topLevelCollection',
    expand: [
      {
        property: 'firstLevelToExpand,
        select: ['field1', 'field2'],
        expand: [
          {
            property: 'secondLevelToExpand',
            select: ['field1', 'field2']
          }
        ]
      }
    ]
  })

This worked perfectly!

  • Is there a reason that they are not officially supported?
  • Is it possible to add a nested expand into the type definition in order to support these officially?
@AleksandrRogov
Copy link
Owner

hi @sgardnerdell! when I first wrote the library and tested nested expands they were not working, maybe it has been fixed with recent updates in Dynamics 365? I will need to retest that. Thanks for letting me know!
And I am glad that you like the library!

@AleksandrRogov
Copy link
Owner

@sgardnerdell I've made changes to type definitions, now you can add nested expand options to your requests!
Thanks

@io-timeout
Copy link
Author

That was quick! Thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants