Code Monkey home page Code Monkey logo

Comments (6)

jordimontana82 avatar jordimontana82 commented on August 24, 2024

Hi @sybaris

You need to install the messages package and set it up in the middleware configuration.

Please have a look at the documentation for more details , in particular the Extra Messages Setup in the middleware docs:

https://dynamicsvalue.github.io/fake-xrm-easy-docs/quickstart/middleware/

And then more info about other message types:

https://dynamicsvalue.github.io/fake-xrm-easy-docs/quickstart/messages/overview/

Hope this helps, any questions let me know.

from fake-xrm-easy.

sybaris avatar sybaris commented on August 24, 2024

Hi

Thanks for your answer.
I have added these 2 lines in my MiddlewareBuilder :

.AddFakeMessageExecutors(Assembly.GetAssembly(typeof(RetrieveVersionRequestExecutor))) .AddGenericFakeMessageExecutors(Assembly.GetAssembly(typeof(NavigateToNextEntityOrganizationRequestExecutor)))

Now I have another error whn trying to connect using Sql4CdsConnection :

'Entity 'sdkmessagerequest' is not found in the metadata cache'

Any idea why we have this ?

Regards
Sybaris

from fake-xrm-easy.

jordimontana82 avatar jordimontana82 commented on August 24, 2024

Great that it was solved. As far as I know, there isn't a sdkmessagerequest entity, but a sdkmessage instead.

Maybe that?

Otherwise please provide a sample unit test so we can reproduce.

Thank you!

from fake-xrm-easy.

sybaris avatar sybaris commented on August 24, 2024

Hi

Here the test method to reproduce :

        [TestMethod]
        public void TestMethod1()
        {
            var context = MiddlewareBuilder
                        .New()
                        .AddCrud()
                        .AddFakeMessageExecutors()
                        .AddFakeMessageExecutors(Assembly.GetAssembly(typeof(RetrieveVersionRequestExecutor)))
                        .AddGenericFakeMessageExecutors(Assembly.GetAssembly(typeof(NavigateToNextEntityOrganizationRequestExecutor)))
                        .UseCrud()
                        .UseMessages()
                        .SetLicense(FakeXrmEasyLicense.RPL_1_5)
                        .Build();

            var service = context.GetOrganizationService();

            var organization = new Entity("organization");
            organization.Id = Guid.NewGuid();
            organization["name"] = "UnitTestOrganization";
            context.Initialize(organization);

            var connection = new Sql4CdsConnection(service);
        }

I use mstest 4.6.2
And these packages nuget :

  <package id="FakeXrmEasy.Abstractions.v9" version="2.3.0" targetFramework="net462" />
  <package id="FakeXrmEasy.Core.v9" version="2.3.0" targetFramework="net462" />
  <package id="FakeXrmEasy.Messages.v9" version="2.3.0" targetFramework="net462" />
  <package id="MarkMpn.Sql4Cds.Engine" version="7.3.0" targetFramework="net462" />

image

I hope you will be able to reproduce and understand what happens...
Regards
Sybaris

from fake-xrm-easy.

sybaris avatar sybaris commented on August 24, 2024

Hi,

Any news about my last post with an example to reproduce ?

Regards
Sybaris

from fake-xrm-easy.

jordimontana82 avatar jordimontana82 commented on August 24, 2024

Thanks @sybaris for the info.

I was indeed able to reproduce . That message is an expected error message that happens when you try to query an entity record that doesn't exist and you're using late bound entity records.

image

In this case, Sql4CdsConnection constructor is trying to query "sdkmessagerequest" records which is triggered via a MetadataCache class in Sql4Cds's engine library. However no records of that type were provided in the .Initialize() call hence the error.

If you provide some test records via .Initialize() before calling such constructor (i.e. sdkmessagerequest) then it should work.

I'd suggest following it from there (looking at Mark's Sql4Cds source code) to see what other records might be needed but my understanding is that not an issue with FakeXrmEasy. https://github.com/MarkMpn/Sql4Cds/blob/5819139ad96dfa34007c3fcce6f87ac0100068d2/MarkMpn.Sql4Cds.Engine/MessageCache.cs#L60

I've seen you raised another issue at that repo that was closed, I'll add a few comments in there as well.

MarkMpn/Sql4Cds#318

from fake-xrm-easy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.