Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does FakeXrmEasy support setting of the entity owner based on the executing user/caller? #168

Open
mivra opened this issue Nov 9, 2024 · 2 comments
Labels
question Further information is requested

Comments

@mivra
Copy link

mivra commented Nov 9, 2024

Hi Jordi,
I cannot find the answer to whether there is a support for automatic setting of the entity owner. The CRM obviously sets the owner to whoever executes the Create request, if the owner is not specified directly. Is there a way how to replicate this behavior in the pipeline execution?
Thanks.

@jordimontana82
Copy link
Contributor

Hi Michal,

It's not documented but it should be possible to override the default CallerId property with the id of the system user executing the request.

https://github.com/DynamicsValue/fake-xrm-easy-core/blob/57ccf1c9aff5658b6ab7a9ffa8a7de113e40ee6d/src/FakeXrmEasy.Core/CallerProperties.cs#L15

Here's a unit test sample:

https://github.com/DynamicsValue/fake-xrm-easy-core/blob/57ccf1c9aff5658b6ab7a9ffa8a7de113e40ee6d/tests/FakeXrmEasy.Core.Tests/Middleware/Crud/FakeMessageExecutors/RetrieveRequestTests/RetrieveRequestTests.cs#L174

Let me know if that works, if so I'll update the docs.

@jordimontana82 jordimontana82 added the question Further information is requested label Nov 11, 2024
@jordimontana82
Copy link
Contributor

@mivra Just following up, was that info helpful?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants