Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Appointment entity plugin code only executed when there are scheduling problems

$
0
0

Hello. I have an issue in CRM 4.0, where plugin code which is registered to run when an Appointment entity is created, only runs if the Appointment's scheduling information (Start Time and End Time) clashes with an Appointment which was previously added. I have used the File.AppendAllText() function from System.IO below to test this:

namespace AppointmentPlugin
{
    public class Plugin: IPlugin
    {
        public void Execute(IPluginExecutionContext context)
        {

            File.AppendAllText(@"C:\Users\user\Desktop\log\AppointmentPlugin.log", "Inside Execute() function");

        }
    }
}

If an Appointment is created with a Start Time and End Time which does not clash with any previously created Appointments, the above code does not run and nothing is written to the AppointmentPlugin.log file. However, if an Appointment is created with a Start Time and End Time which clashes with any previously created Appointments, the below Scheduling Alerts pop up appears and after clicking 'Ignore and Save', the above plugin code is executed and "Inside Execute() function" is written to AppointmentPlugin.log. Is there anyway to get the above code to run when an Appointment is created with no clashes?




Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images