Forum Discussion
Duplicate key quote entity Dynamics CRM
- 9 years ago
The solution for the problem is to add filter and select statements directly in the OData request. When you select the quote entity in the user interface, the M expression in the advanced editor looks like this:
let
Source = OData.Feed("https://<SERVERURL>/<ORGANIZATION>/api/data/v8.0/"),
quotes_table = Source{[Name="quotes",Signature="table"]}[Data]
in
quotes_tableThe following M expression shows how to filter the OData query directly:
let
Source = OData.Feed("https://<SERVERURL>/<ORGANIZATION>/api/data/v8.0/quotes?$select=quoteid,createdon,_createdby_value,statecode"),
quotes_table = Table.SelectColumns(Source,{"quoteid","_createdby_value","statecode"})
in
quotes_tableWith this procedure you simply select the columns you really need and therefore we can avoid the error with duplicate keys.
The solution for the problem is to add filter and select statements directly in the OData request. When you select the quote entity in the user interface, the M expression in the advanced editor looks like this:
let
Source = OData.Feed("https://<SERVERURL>/<ORGANIZATION>/api/data/v8.0/"),
quotes_table = Source{[Name="quotes",Signature="table"]}[Data]
in
quotes_table
The following M expression shows how to filter the OData query directly:
let
Source = OData.Feed("https://<SERVERURL>/<ORGANIZATION>/api/data/v8.0/quotes?$select=quoteid,createdon,_createdby_value,statecode"),
quotes_table = Table.SelectColumns(Source,{"quoteid","_createdby_value","statecode"})
in
quotes_table
With this procedure you simply select the columns you really need and therefore we can avoid the error with duplicate keys.