web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Calendar Rules

(1) ShareShare
ReportReport
Posted on by

In dynamics CRM 365 calendarRules entity, can someone please explain the use of extentcode, timecode, subcode,effort,rank attributes? Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • Andreas Cieslik Profile Picture
    9,267 on at

    Good explanation comes from Inogic:

    www.inogic.com/.../creating-calendar-rules-with-breaks-in-microsoft-dynamics-crm-2015

  • sruthie Profile Picture
    on at

    Already checked it out. was not much helpful. Can u suggest some other link which contains detailed description about the attributes?

  • Suggested answer
    Andreas Cieslik Profile Picture
    9,267 on at

    extentcode:

    The ExtentCode attribute defines how calendar rule overlap is handled during calendar rule expansion.

    The following table shows the values for this class.

    SubtractRecurrenceIntervals

    1

    The recurrence duration determines the shadowing of that rule. Use this value to indicate working hours and a full day 24-hour shadow.

    SubtractResults

    2

    Specifies that only the rule duration is shadowed. Use this value to indicate time off. For example, 4 hours of time off allow working hours to appear before and after.

    Transparent

    0

    Specifies no shadowing of calendar rules. All rules are displayed even if they are shadowed or preceded by other rules.

    timecode:

    Type of calendar rule such as working hours, break, holiday, or time off. 0 for working hours.

    Available

    0

    The time is available within the working hours of the resource.

    Busy

    1

    The time is committed to an activity.

    Unavailable

    2

    The time is unavailable.

    Filter

    3

    Use additional filters for the time block such as service cost or service start time.

    subcode:

    Sample with timecode and subcode:

                            // The person is available and able to be scheduled during this time 

                            level1Rule.timecode = new CrmNumber((int)TimeCode.Available); 

                            level1Rule.subcode = new CrmNumber((int)SubCode.Schedulable);

                            // They are not available during lunch 

                            lunchBreak.timecode = new CrmNumber((int)TimeCode.Unavailable);

                            // Because it is a break 

                            lunchBreak.subcode = new CrmNumber((int)SubCode.Break);

    Unspecified

    0

    Specifies free time with no specified restrictions.

    Schedulable

    1

    A schedulable block of time.

    Committed

    2

    A block of time that is committed to perform an action.

    Uncommitted

    3

    A block of time that is tentatively scheduled but not committed.

    Break

    4

    A block of time that cannot be committed due to a scheduled break.

    Holiday

    5

    A block of time that cannot be scheduled due to a scheduled holiday.

    Vacation

    6

    A block of time that cannot be scheduled due to a scheduled vacation.

    Appointment

    7

    A block of time that is already scheduled for an appointment.

    ResourceStartTime

    8

    Specifies to filter a resource start time.

    ResourceServiceRestriction

    9

    A restriction for a resource for the specified service.

    ResourceCapacity

    10

    Specifies the capacity of a resource for the specified time interval.

    ServiceRestriction

    11

    Specifies that a service is restricted during the specified block of time.

    ServiceCost

    12

    An override to the service cost for the specified time block.

    effort:

    Effort available for a resource during the time described by the calendar rule

    rank:

    (e.g. 0 is like the base rule, high numbers like 1, 2, 3... would be calendar rule instances that would override the validity or scope of the base calendar rule.

  • MoMo Profile Picture
    430 on at

    Hi

    Ia it possible to create calendar for a user for different services on the same day

    E.g. User A skills are Plumber, Electrcian and Technician

    On a given date from 9am to 12pm he is available only for Plumbing and Electrical work

    On the same day from 3:00 pm to 6:00 pm he is available for Technician.

    How i can achieve this Scenario?

  • Andreas Cieslik Profile Picture
    9,267 on at

    Hi,

    Scott Le Fante had this answer for this question:

    You could have different requirements views for scheduling. Otherwise what they could do is possibly color code things a different color

    My idea was to create multiple bookable resources for one user. But Field Service prevents this.

    Sorry so far no better solution.

  • Suggested answer
    TaTikoma Profile Picture
    5 on at

    Hi, i know two solutions for scheduling different service on one user/equipment.
    1. From UI Dynamics Crm can use service restrictions of work hours for user/equipment

    ElectricalCheck.PNG

     WorkHours.PNG

     Service-restrictions.PNG

    You can check it's from dialog "schedule service activity".
    ElectricalCheck.PNG

    2. Second solution - create calendarrules from code for every service 

    //Available time:
    rule_A1["subcode"] = SubCode.Schedulable;
    rule_A1["timecode"] = TimeCode.Available;
    rule_A1["extentcode"] = 0;
    rule_A1["effort"] = 0.0;
    rule_A1["serviceid"] = serviceReference_Electrical;
    rule_A1["offset"] = 540; //09:00 am
    rule_A1["duration"] = 240; //09:00 am - 01:00 pm
    
    //A2... rule_A2["serviceid"] = serviceReference_Plumbing; rule_A2["offset"] = 540; //09:00 am rule_A2["duration"] = 240; //09:00 am - 01:00 pm
    //A3... rule_A3["serviceid"] = serviceReference_Technical; rule_A3["offset"] = 840; //02:00 pm rule_A3["duration"] = 240; //02:00 pm - 06:00 pm //Filter time : rule_F1["subcode"] = SubCode.ResourceServiceRestriction; rule_F1["timecode"] = TimeCode.Filter; rule_F1["extentcode"] = 0; rule_F1["serviceid"] = serviceReference_Electrical; rule_F1["offset"] = 840; //02:00 pm rule_F1["duration"] = 240; //02:00 pm - 06:00 pm
    //F2... rule_F2["serviceid"] = serviceReference_Plumbing; rule_F2["offset"] = 840; //02:00 pm rule_F2["duration"] = 240; //02:00 pm - 06:00 pm
    //F3... rule_F3["serviceid"] = serviceReference_Technical; rule_F3["offset"] = 540; //09:00 am rule_F3["duration"] = 240; //09:00 am- 1:00 pm //Filter time for ResourceCapacity rule_C["effort"] = 1.0; rule_C["extentcode"] = 1; rule_C["rank"] = 100; rule_C["subcode"] = SubCode.ResourceCapacity; rule_C["timecode"] = TimeCode.Filter;
    rule_C["offset"] = 0;
    rule_C["duration"] = 1440;

    By default, the capacity of the available rules is summed over the same time period.
    Therefore, in the rules rule_AX ["effort"] is set to 0.0, not 1.
    And created filter capacity with effort = 1.0 for full day.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans