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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

How to create recurring Sub Task under a recurring Main Task

(0) ShareShare
ReportReport
Posted on by 90

Hello,

I have a requirement to build 'To Do Management system' in CRM where we managed multiple level of Tasks and there reporting from Users. Here some Task will be generate automatically (Weekly & Monthly) and there sub task also.

For this we have modify the "Appointment Entity" & "Recurring Appointment Entity" from where Main Task has generated properly but, how can I generate sub task under a Main Task.

Please suggest how can I do it

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    Hello,

    You can create relationship between Appointment and recurring Appointment.

    Then use below code in your plugin/custom workflow to create recurring Appointment from c#

    // Define an anonymous type to define the possible recurrence pattern values.
                        var RecurrencePatternTypes = new
                        {
                            Daily = 0,
                            Weekly = 1,
                            Monthly = 2,
                            Yearly = 3
                        };
    
                        // Define an anonymous type to define the possible values for days 
                        // of the week
                        var DayOfWeek = new
                        {
                            Sunday = 0x01,
                            Monday = 0x02,
                            Tuesday = 0x04,
                            Wednesday = 0x08,
                            Thursday = 0x10,
                            Friday = 0x20,
                            Saturday = 0x40
                        };
    
                        // Define an anonymous type to define the possible values  
                        // for the recurrence rule pattern end type.
                        var RecurrenceRulePatternEndType = new
                        {
                            NoEndDate = 1,
                            Occurrences = 2,
                            PatternEndDate = 3
                        };
    
                        // Create a recurring appointment
                        RecurringAppointmentMaster newRecurringAppointment = new RecurringAppointmentMaster
                            {
                                Subject = "Sample Recurring Appointment",
                                StartTime = DateTime.Now.AddHours(1),
                                EndTime = DateTime.Now.AddHours(2),
                                RecurrencePatternType = new OptionSetValue(RecurrencePatternTypes.Weekly),
                                Interval = 1,
                                DaysOfWeekMask = DayOfWeek.Thursday,
                                PatternStartDate = DateTime.Today,
                                Occurrences = 10,
                                PatternEndType = new OptionSetValue(RecurrenceRulePatternEndType.Occurrences)
                            };
    
                        _recurringAppointmentMasterId = _serviceProxy.Create(newRecurringAppointment);

    Then You can add subgrid of RecurringAppointment on Appointment to show sub tasks.

    Make sure you also set lookup field which got created from custom relationship.

    Code is available in CRM SDK - D:\CRM Tools\Dynamics 365\SDK\SampleCode\CS\BusinessDataModel\ScheduleAndAppointment

    Please mark my answer verified if i were helpful

  • Sakib Profile Picture
    90 on at

    In this way we can create the Main Task but what about the relatable Sub Task, can we create sub task in this way

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 151 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 134

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 55 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans