-
Notifications
You must be signed in to change notification settings - Fork 48
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
Update and Retrieve in a single request #348
Comments
|
I want to |
To clarify a few things... The Dataverse WebAPI is implemented on the Organization API. The Organization API is what is directly exposed in this client. In the webAPI when Prefer: return=representation is used, the WebAPI interface is making multiple calls to the organization api. That operation a very inefficient and expensive operation, specifically in the case of 'non-create' as the size of the existing record can be quite large (and time consuming in relative terms). Thus, we wanted to encourage a user that needed that functionality to explicitly think about it, ideally filtering the return set of information, which you can do in the webAPI, though its rarely used. Based on our telemetry of API operations, In most cases when an update occurs, it's a point update (1 or more fields) and the resulting data in the record, that data that was not touched in the update, is less important to the caller. That said, we have considered adding an extension to the client for that purpose (Update and return record), requiring the caller to provide a column set to be returned to discourage the bad habit of "all columns". It has been on our 'to-do list' of items we have for extensions to the client for a while. |
@MattB-msft thanks for the update.
This will be added to https://github.com/microsoft/PowerPlatform-DataverseServiceClient/blob/master/src/GeneralTools/DataverseClient/Client/Interfaces/IOrganizationServiceAsync2.cs? Or maybe another interface should be created to ensure backward compatibility. Also, https://github.com/microsoft/PowerPlatform-DataverseServiceClient/blob/master/src/GeneralTools/DataverseClient/Client/Interfaces/IOrganizationServiceAsync2.cs#L42 should be marked as deprecated, so the users will always use version with ColumnSet
Didn't know that, but the client will do a single web request to the API? I'm using Fiddler to catch all requests going from my app to dynamics, so the end goal is to do a single request (with Prefer: return=representation) and get the updated/created entity instead of doing two requests. |
Should we implement the Update behavior, we will have a discussion internally as to building it out as an IOrganziationService*3, or an extension to OrganizationService* The create is less interesting to add a column set too as creates typically do not do a lot , we will discuss it though. |
@MattB-msft any updates? |
The next drop will include the implementation for CreateAndReturnAsync with the existing contract, (there is not a sync version of it right now). that will be part of the last release of the 1.0.x version stream. We will look at picking up variations of it and an update variation in the 1.1.x release versions which will come after the next drop. |
Any updates? |
Currently, to update the record and get the updated record from dynamics we must call two methods:
Update(Async)
andRetrieve(Async)
. Ideally, we should be able to same thing with only a single request, similar toCreateAndReturnAsync
(which isn't implemented btw).The idea behind this FR is to be able to minimize the number of requests than need to be done to get the result.
This is available via WebApi (https://learn.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/mt607664(v=crm.8)#update-with-data-returned), so ideally it should be possible to do with the library
The text was updated successfully, but these errors were encountered: