Beschreibung:
Es wird überprüft, wie viele ganztägige Termine (im Vergleich zur Gesamtanzahl an Terminen) vorhanden sind.
VBScript:
Dim nCount : nCount = 0
Dim nCountAllAppointments : nCountAllAppointments = cRM.CurrentProject.timemanager.Appointments.Count
Dim nCountAllDayEvents : nCountAllDayEvents = 0
Dim oAppointment
For nCount = 1 To nCountAllAppointments
Set oAppointment = cRM.CurrentProject.timemanager.Appointments.Item(nCount)
If (oAppointment.AllDayEvent = True) Then
nCountAllDayEvents = nCountAllDayEvents + 1
End If
Set oAppointment = Nothing
Next
Call cRM.DialogMessageBox("Bei der Gesamtanzahl von " & CStr(nCountAllAppointments) & " Terminen, gibt es " & CStr(nCountAllDayEvents) & " ganztägige Termine.", "Appointments.Item", vbOkonly)
C#-Script:
int count = 0;
long countAllAppointments = cRM.CurrentProject.TimeManager.Appointments.Count;
int countAllDayEvents = 0;
Appointment appointment;
for (count = 1; count <= countAllAppointments; count++)
{
appointment = cRM.CurrentProject.TimeManager.Appointments.Item(count);
if (appointment.AllDayEvent == true)
{
countAllDayEvents++;
}
appointment.Dispose();
}
cRM.DialogMessageBox("Bei der Gesamtanzahl von " + countAllAppointments.ToString() + " Terminen, gibt es " + countAllDayEvents + " ganztägige Termine.", "Appointments.Item", 0);
TypeScript:
import {
cRM,
Appointment
} from "./sdk/combitCRM.SDK.WindowsClient.v13";
let count : number = 0;
const countAllAppointments : number = cRM.CurrentProject.TimeManager.Appointments.Count;
let countAllDayEvents : number = 0;
let appointment : Appointment;
for (count = 1; count <= countAllAppointments; count++) {
appointment = cRM.CurrentProject.TimeManager.Appointments.Item(count);
if (appointment.AllDayEvent === true) {
countAllDayEvents++;
}
}
cRM.DialogMessageBox(`Bei der Gesamtanzahl von ${countAllAppointments} Terminen, gibt es ${countAllDayEvents} ganztägige Termine.`, "Appointments.Item", 0);