Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

How to get calendarrules programmatically

Posted on by

Hi,

I'm trying to get a list of days within a Holiday Schedule.

As said here, there are no messages that directly operate on CalendarRule, and you can access this entity by using the messages on the Calendar entity.

So with this I thought I could access the effectiveintervalend which is a field of calendarrules with a QueryExpression on Calendar but I get Calendar' entity doesn't contain attribute with Name = 'effectiveintervalend

 


I've been trying to use this query from here EntityCollection calendarRules = (EntityCollection)calendar.Attributes["calendarrules"] but The given key was not present in the dictionary

 

Any guidance on this please?

*This post is locked for comments

  • Jorge S Profile Picture
    Jorge S on at
    RE: How to get calendarrules programmatically

    Thanks, GetAttributeValue<EntityCollection>("calendarrules").Entities did the trick

  • Verified answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: How to get calendarrules programmatically

    Hello,

    Did you check: salimadamoncrm.com/.../retrieving-business-closure-dates-from-dynamics-crm it will give you some reference

  • Suggested answer
    Emre GULCAN Profile Picture
    Emre GULCAN 2,379 on at
  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: How to get calendarrules programmatically

    Hi,

    For effectiveintervalend and calendarrules  issue, calendar entity doesn't have these fields. Please see a list of available field via below links.

    Calendar Entity

    - docs.microsoft.com/.../calendar

    Calendar Rule entity

    - docs.microsoft.com/.../calendarrule

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans