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

Is there a way to update batch item’s URL? #3022

Open
lucacivale opened this issue Jul 25, 2024 · 0 comments
Open

Is there a way to update batch item’s URL? #3022

lucacivale opened this issue Jul 25, 2024 · 0 comments
Assignees

Comments

@lucacivale
Copy link

The Microsoft Dynamics 365 endpoint exposes a custom query option called cross-company . This option must be set on each request if cross company behavior is needed.

Currently we use the DataServiceClientRequestPipelineConfiguration.OnMessageCreating delegate to modify the url and add the query option for each request indvidually. This doesn't work for batch requests because we have to set the option on each batch item url.

Afaik the only way to modify each batch item url is to subscribe to the BuildingRequest event and modify the url there. The downside here is that we can't configure the query option for each request without manually subscribing and unsubscribing from the event.

While creating the batch request the top level request calls the ODataMessageWritingHelper.CreateRequestMessage which will execute the DataServiceClientRequestPipelineConfiguration.OnMessageCreating delegates but the batch items call ODataRequestMessageWrapper.CreateBatchPartRequestMessage which doesn't execute the delegates.

@habbes habbes self-assigned this Jul 30, 2024
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