DynamicsValue / fake-xrm-easy

FakeXrmEasy: The Test Automation Framework for the Power Platform / Dataverse
https://dynamicsvalue.github.io/fake-xrm-easy-docs/why/
Other
26 stars 12 forks source link

RetrieveCurrentOrganisationRequest is missing #136

Open jordimontana82 opened 8 months ago

jordimontana82 commented 8 months ago

Add implementation for the above organisation request, that allows to retrieve information about the organisation you're currently connected to.

https://learn.microsoft.com/en-us/dotnet/api/microsoft.crm.sdk.messages.retrievecurrentorganizationrequest?view=dataverse-sdk-latest

jordimontana82 commented 4 months ago

Added to https://dynamicsvalue.github.io/fake-xrm-easy-docs/releases/2x/2.5.0/

ozdemir-mehmet commented 3 months ago

@jordimontana82 was it a deliberate decision to only include OrganizationDataService in this implementation? As OrganisationService and WebApplication are also valid Enums

https://github.com/DynamicsValue/fake-xrm-easy-messages/commit/05db9a35fe6907cfa2c1e1d66792832b0d696dc8

 if (orgDetail == null)
            {
                orgDetail = new OrganizationDetail()
                {
                    Endpoints = 
                    {
                        { EndpointType.OrganizationDataService, "http://baseUrl/XrmServices/2011/OrganizationDataService.svc" }
                    }
                };
            }
[DataContract(Name = "EndpointType", Namespace = "http://schemas.microsoft.com/xrm/2014/Contracts")]
public enum EndpointType
{
    [EnumMember]
    OrganizationService,
    [EnumMember]
    OrganizationDataService,
    [EnumMember]
    WebApplication
}
jordimontana82 commented 3 months ago

Hi @ozdemir-mehmet ,

Good point, yes, this message was introduced mostly as it was needed for another piece of work. Do you need to use the other endpoints?

ozdemir-mehmet commented 3 months ago

Yep using WebApplication, I think if all three are added just following the same pattern it should be enough. Even better being able initialise them as part of the test setup?

I've done something like this in the meantime as my unit tests were failing :)

`

        try
        {
            var uriString = response.Detail.Endpoints[EndpointType.WebApplication];
            return new Uri(uriString);
        }
        catch { return null; }

`