{{fscript globals setAppointmentsForDisplay:selectedObjects. }}

{{localize 'Appointment Summary'}}

{{foreach appointment appointmentsForDisplay do}}

{{appointment.subject}}

{{if appointment.statusString}}{{localize 'Status'}}: {{appointment.statusString}}
{{endif}} {{if appointment.typeString}}{{localize 'Type'}}: {{appointment.typeString}}
{{endif}}
{{if appointment.startDate}}{{localize 'Start Date'}}: {{appointment.startDate.mcLongDateTime}}
{{endif}} {{if appointment.endDate}}{{localize 'End Date'}}: {{appointment.endDate.mcLongDateTime}}
{{endif}} {{if appointment.timeZoneName}}{{localize 'Timezone'}}: {{appointment.timeZoneName}}
{{endif}}
{{if appointment.category}}{{localize 'Category'}}: {{appointment.category.name}}
{{endif}} {{if appointment.keywordsString}}{{localize 'Keywords'}}: {{appointment.keywordsString}}
{{endif}}
{{if appointment.details}}{{localize 'Details'}}:
{{appointment.details}}
{{endif}}
{{if appointment.tasks.@count}}
{{localize 'TASKS'}}

{{foreach task appointment.tasks do}} {{task.title}}
{{if task.dueDate}}{{localize 'Due'}}: {{task.dueDate.mcLongDate}}
{{endif}} {{if task.startDate}}{{localize 'Start Date'}}: {{task.startDate.mcLongDate}}
{{endif}} {{if task.completeDate}}{{localize 'End Date'}}: {{task.completeDate.mcLongDate}}
{{endif}} {{if task.priorityString}}{{localize 'Priority'}}: {{task.priorityString}}
{{endif}}
{{endforeach do}} {{endif}} {{if appointment.projects.@count}}
{{localize 'PROJECTS'}}

{{foreach project appointment.projects do}} {{project.name}}
{{localize 'Status'}}: {{project.statusString}}
{{localize 'Due Date'}}: {{project.dueDate.mcLongDate}}
{{localize 'Start Date'}}: {{project.startDate.mcLongDate}}
{{localize 'Complete Date'}}: {{project.completeDate.mcLongDate}}

{{endforeach do}} {{endif}} {{if appointment.opportunities.@count}}
{{localize 'OPPORTUNITIES'}}

{{foreach opportunity appointment.opportunities do}} {{opportunity.name}}
{{localize 'Status'}}: {{opportunity.opportunityStateString}}
{{localize 'Due Date'}}: {{opportunity.dueDate.mcLongDate}}
{{localize 'Start Date'}}: {{opportunity.startDate.mcLongDate}}
{{localize 'Complete Date'}}: {{opportunity.completeDate.mcLongDate}}

{{endforeach do}} {{endif}} {{if appointment.groups.@count}}
{{localize 'GROUPS'}}

{{foreach group appointment.groups do}} {{group.name}}
{{if group.startDate}}{{localize 'Start Date'}}: {{group.startDate.mcLongDate}}
{{endif}} {{if group.endDate}}{{localize 'End Date'}}: {{group.endDate.mcLongDate}}
{{endif}}
{{endforeach do}} {{endif}} {{if appointment.customRecordSets.@count}}
{{localize 'FORMS'}}

{{foreach recordSet appointment.customRecordSets do}} {{recordSet.customRecordSetDefinition.name}}
{{foreach record recordSet.customRecords do}} {{if record.displayString}} {{record.customRecordDefinition.name}}
{{record.displayString}}{{endif}}
{{endforeach do}}
{{endforeach do}}
{{endif}} {{if appointment.notes.@count}}
{{localize 'NOTES'}}

{{foreach note appointment.notesSortedByCreateDateDescending do}} {{localize 'Title'}}: {{note.title}}
{{localize 'Create Date'}}: {{note.createDate.mcLongDateTime}}
{{localize 'Content'}}: {{note.attachmentFreeTextRepresentation}}


{{endforeach do}} {{endif}} {{if appointment.emails.@count}}
{{localize 'EMAILS'}}

{{foreach email appointment.emails do}} {{localize 'Subject'}}: {{email.subject}}
{{localize 'Sender'}}: {{email.fromString}}
{{localize 'Create Date'}}: {{email.createDate.mcLongDateTime}}
{{localize 'Content'}}: {{email.largeData.plainTextRepresentation}}


{{endforeach do}} {{endif}}



{{endforeach do}}
{{localize 'Generated by %@ on %@', objectContext.user.contact.cachedName, date}}.