Skip to content
This repository has been archived by the owner on Jun 16, 2024. It is now read-only.

The entity logical name is not valid #406

Closed
suleimanali opened this issue Mar 18, 2019 · 2 comments
Closed

The entity logical name is not valid #406

suleimanali opened this issue Mar 18, 2019 · 2 comments

Comments

@suleimanali
Copy link

suleimanali commented Mar 18, 2019

Having issues with testing a workflow. Its throwing an exception "The entity logical name [EntityName] is not valid".

Here's the code snippet:
FakeXrmTestMethod

FakeXrmEntityLogicalName

@BetimBeja
Copy link
Contributor

Hello @suleimanali,
most probably you are querying the IOrganizationService for ca_configuration but you are not initializing your context with the necessary data. Also any other entity assumed to be existing for your particular test case should be initialized.

var xrmFakedContext = new XrmFakedContext();
xrmFakedContext.Initialize(entity);

This suggested change should fix your problem.

Best regards,
Betim.

@suleimanali
Copy link
Author

Thank you very much @BetimBeja.
It worked perfectly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants