fake-xrm-easy icon indicating copy to clipboard operation
fake-xrm-easy copied to clipboard

RetrieveEntityDataSource is returning null value

Open ilazarevski opened this issue 2 years ago • 3 comments

Describe the bug When calling the RetrieveEntityDataSource method from IEntityDataSourceRetrieverService, always is retuning null value, despite the defined "DataSourceId" and "DataProviderId" in the metadata of the virtual entity.

Expected behavior Entity data source defined for the virtual entity.

** FakeXrmEasy and Dynamics 365 / CRM version ** FakeXrmEasy v9 (1.57.1). Core Assemblies v 9.0.0.7.

Screenshots image image

ilazarevski avatar Oct 10 '21 17:10 ilazarevski

Hello @ilazarevski , look at the example test written here: https://github.com/jordimontana82/fake-xrm-easy/blob/06293819e051d623a6d136dd91dc66447a30fe52/FakeXrmEasy.Tests.Shared/Features/RetrieveMultipleDataProviderTesting.cs#L12-L31

I don't think it is a bug, it just has been implemented differently from what you were expecting.

BetimBeja avatar Oct 10 '21 17:10 BetimBeja

Thanks @ilazarevski @BetimBeja

Indeed, the initialization is as per Betim's answer. I suppose if the community finds it valuable to also initialize the EntityDataSourceRetriever based on metadata . For example, as long as the EntityMetadata has both the DataProviderId and DataSourceId properties?

jordimontana82 avatar Oct 10 '21 18:10 jordimontana82

@BetimBeja thanks for your answer. I understand that is different implementation, but in our case we are consuming the IEntityDataSourceRetrieverService service. From the other hand, the service gets metadata of virtual entity and uses DataSourceId property to find used data source entity. If it's configured properly it will retrieve the custom data source entity (that's where you store URL and credentials for your external data service) with all columns. @jordimontana82 you are right, as long as the both fields DataProviderId and DataSourceId are populated.

ilazarevski avatar Oct 10 '21 18:10 ilazarevski