-
Notifications
You must be signed in to change notification settings - Fork 182
Calendar entity service.retrieve not returning the calendarrules attribute #528
Comments
Since the implementation of the IOrganizationService is based on Fakes you can Fake the result for your retrieve on this test, so that it returns the expected result: A.CallTo(() => service.Retrieve("calendar", A<Guid>._, A<ColumnSet>._)).Returns(new Entity("calendar") {Id=Guid.NewGuid() }); |
Hi @durgaprasadkatari thanks for raising this. Just wondering if you tried an advanced find that produces the same as that .Retrieve but with a FetchXml query that returns the calendar rules? If that's the case then you could query it that way for the time being. Otherwise, feel free to try what @BetimBeja suggested . I might look into this as an enhancement for the next version. |
Hi @jordimontana82
But I also tried the @BetimBeja approach now and it is also solved my problem. I changed my plugin code back to service.retrieve(). |
Do you want to close this issue? |
Yes, I'm closing it and moving the enhancement to a separate issue #532 |
I'm facing an issue with service.retrieve call on the calendar entity. Calendar is special type entity in MS CRM when we do the retrieve call it will automatically return the "calendarrules" entity collection attribute, but if we specify the "calendarrules" in the columnset it is throwing the error "attribute doesn't exist in the calendar entity".
To fix the unit test I have added the "calendarrules" attribute in the service.retrieve call but this is throwing the error in CRM. Please suggest a workaround to resolve this issue.
var holidaySchedule = service.Retrieve("calendar", serviceCalendarId, new ColumnSet("calendarid", "calendarrules"));
@BetimBeja @jordimontana82
The text was updated successfully, but these errors were encountered: