= load( local!rating, local!feedback, local!sendRemindersTime: if( and( not( isnull( ri!meetingData.sendReminders ) ), ri!meetingData.sendReminders ), apply( rule!OK_MMS_ER_getDifferenceBetweenMinutesOfDateTimes( ri!meetingData.meetingStartDtTime, _ ), ri!meetingData.sendRemindersDtTime ), null ), a!formLayout( label: if( and( not( isnull( ri!isCreateTask ) ), ri!isCreateTask ), "Create Meeting", if( and( not( isnull( ri!isEditTask ) ), ri!isEditTask ), "Edit Meeting", if( and( not( isnull( ri!isCancelTask ) ), ri!isCancelTask ), "Cancel Meeting", if( and( not( isnull( ri!isAddNoteTask ) ), ri!isAddNoteTask ), "Add Note to the Meeting", if( and( not( isnull( ri!isCheckInTask ) ), ri!isCheckInTask ), "Meeting Check In", if( and( not( isnull( ri!isSummaryTask ) ), ri!isSummaryTask ), "Provide Meeting Summary", if( and( not( isnull( ri!isFeedbackTask ) ), ri!isFeedbackTask ), "Provide Meeting Feedback", "" ) ) ) ) ) ) ), instructions: if( and( not( isnull( ri!isReadOnly ) ), ri!isReadOnly, not( isnull( ri!isCheckInTask ) ), ri!isCheckInTask ), "Please check in to the meeting.", "Please fill the information in all the mandatory fields." ), firstColumnContents: { a!sectionLayout( label: "Meeting Details", firstColumnContents: { a!textField( label: "Subject", labelPosition: "ADJACENT", value: ri!meetingData.meetingSubject, saveInto: ri!meetingData.meetingSubject, refreshAfter: "UNFOCUS", required: if( ri!isReadOnly, false, true ), readOnly: ri!isReadOnly, validations: { rule!OK_MMS_ER_textValidationRule( "Subject", ri!meetingData.meetingSubject, 500 ) } ), a!dateTimeField( label: "Start Date/Time", labelPosition: "ADJACENT", value: ri!meetingData.meetingStartDtTime, saveInto: ri!meetingData.meetingStartDtTime, required: if( ri!isReadOnly, false, true ), readOnly: ri!isReadOnly, validations: { if( and( not( isnull( ri!isReadOnly ) ), not( ri!isReadOnly ), ri!meetingData.meetingStartDtTime < now() ), "Please select the future meeting start date time.", {} ) } ), if( and( not( isnull( ri!isReadOnly ) ), ri!isReadOnly ), a!textField( label: "Duration", labelPosition: "ADJACENT", value: ri!meetingData.meetingDuration / 60 & " Hrs", readOnly: ri!isReadOnly ), a!dropdownField( label: "Duration", labelPosition: "ADJACENT", placeholderLabel: "Please Select", choiceLabels: cons!OK_MMS_DURATION_LABELS, choiceValues: cons!OK_MMS_DURATION_VALUES, value: ri!meetingData.meetingDuration, saveInto: ri!meetingData.meetingDuration, required: if( ri!isReadOnly, false, true ) ) ), a!paragraphField( label: "Description", labelPosition: "ADJACENT", value: ri!meetingData.meetingDesc, saveInto: ri!meetingData.meetingDesc, required: if( ri!isReadOnly, false, true ), readOnly: ri!isReadOnly, validations: { rule!OK_MMS_ER_textValidationRule( "Description", ri!meetingData.meetingDesc, 2000 ) } ) }, secondColumnContents: { a!textField( label: "Location", labelPosition: "ADJACENT", value: ri!meetingData.meetingLocation, saveInto: ri!meetingData.meetingLocation, refreshAfter: "UNFOCUS", required: if( ri!isReadOnly, false, true ), readOnly: ri!isReadOnly, validations: { rule!OK_MMS_ER_textValidationRule( "Location", ri!meetingData.meetingLocation, 500 ) } ), a!pickerFieldUsers( label: "Invite Attendees", labelPosition: "ADJACENT", groupFilter: cons!OK_MMS_ALL_USERS_GROUP, value: ri!meetingData.meetingAttendees, saveInto: ri!meetingData.meetingAttendees, required: if( ri!isReadOnly, false, true ), readOnly: ri!isReadOnly ), if( and( not( isnull( ri!isReadOnly ) ), ri!isReadOnly ), { a!textField( label: "Send Reminders?", labelPosition: "ADJACENT", value: if( and( not( isnull( ri!meetingData.sendReminders ) ), ri!meetingData.sendReminders ), "Yes", "No" ), readOnly: ri!isReadOnly ), if( and( not( isnull( ri!meetingData.sendReminders ) ), ri!meetingData.sendReminders ), { a!textField( label: "Reminders Set", labelPosition: "ADJACENT", value: index( cons!OK_MMS_WHEN_TO_SEND_REMINDERS_LABELS, wherecontains( local!sendRemindersTime, cons!OK_MMS_WHEN_TO_SEND_REMINDERS_VALUES ), {} ), readOnly: ri!isReadOnly ), a!textField( label: "Review/Edit Reminder Before Sending?", labelPosition: "ADJACENT", value: if( and( not( isnull( ri!meetingData.editReminderBeforeSending ) ), ri!meetingData.editReminderBeforeSending ), "Yes", "No" ), readOnly: ri!isReadOnly ) }, {} ) }, { a!dropdownField( label: "Send Reminders?", labelPosition: "ADJACENT", placeholderLabel: "Please Select", choiceLabels: cons!OK_MMS_BOOLEAN_LABELS, choiceValues: { true, false }, value: ri!meetingData.sendReminders, saveInto: ri!meetingData.sendReminders, required: if( ri!isReadOnly, false, true ) ), if( and( not( isnull( ri!meetingData.sendReminders ) ), ri!meetingData.sendReminders ), { with( a!multipleDropdownField( label: "When to Send Reminders?", labelPosition: "ADJACENT", choiceLabels: cons!OK_MMS_WHEN_TO_SEND_REMINDERS_LABELS, choiceValues: cons!OK_MMS_WHEN_TO_SEND_REMINDERS_VALUES, value: local!sendRemindersTime, saveInto: local!sendRemindersTime, required: if( ri!isReadOnly, false, true ), disabled: if( isnull( ri!meetingData.meetingStartDtTime ), true, false ), validations: { rule!OK_MMS_ER_sendRemindersDtTimeFieldValidation( todatetime( ri!meetingData.meetingStartDtTime ), tointeger( { local!sendRemindersTime } ) ) } ) ), a!dropdownField( label: "Review/Edit Reminder Before Sending?", labelPosition: "ADJACENT", placeholderLabel: "Please Select", choiceLabels: cons!OK_MMS_BOOLEAN_LABELS, choiceValues: { true, false }, value: ri!meetingData.editReminderBeforeSending, saveInto: ri!meetingData.editReminderBeforeSending, required: if( ri!isReadOnly, false, true ) ) }, {} ) } ) } ), if( or( and( not( isnull( ri!isCreateTask ) ), ri!isCreateTask ), and( not( isnull( ri!isEditTask ) ), ri!isEditTask ) ), {}, a!sectionLayout( label: if( and( not( isnull( ri!isCancelTask ) ), ri!isCancelTask ), "Cancellation Details", if( and( not( isnull( ri!isAddNoteTask ) ), ri!isAddNoteTask ), "Note Details", if( and( not( isnull( ri!isSummaryTask ) ), ri!isSummaryTask ), "Summary Details", if( and( not( isnull( ri!isFeedbackTask ) ), ri!isFeedbackTask ), "Feedback Details", {} ) ) ) ), firstColumnContents: { if( and( not( isnull( ri!isCancelTask ) ), ri!isCancelTask ), { a!paragraphField( label: "Reason", labelPosition: "ADJACENT", value: ri!genericMessage, saveInto: ri!genericMessage, required: true, validations: { rule!OK_MMS_ER_textValidationRule( "Reason", ri!genericMessage, 500 ) } ) }, if( and( not( isnull( ri!isAddNoteTask ) ), ri!isAddNoteTask ), { a!paragraphField( label: "Note", labelPosition: "ADJACENT", value: ri!genericMessage, saveInto: ri!genericMessage, required: true, validations: { rule!OK_MMS_ER_textValidationRule( "Note", ri!genericMessage, 2000 ) } ) }, if( and( not( isnull( ri!isSummaryTask ) ), ri!isSummaryTask ), { a!textField( label: "Summary", labelPosition: "ADJACENT", required: true, value: ri!meetingData.postMeetingSummary, saveInto: ri!meetingData.postMeetingSummary, validations: { rule!OK_MMS_ER_textValidationRule( "Summary", ri!meetingData.postMeetingSummary, 500 ) } ) }, if( and( not( isnull( ri!isFeedbackTask ) ), ri!isFeedbackTask ), { a!dropdownField( label: "How will you rate the meeting?", labelPosition: "ADJACENT", required: true, choiceLabels: cons!OK_MMS_RATING_LABELS, choiceValues: cons!OK_MMS_RATING_VALUES, placeholderLabel: "Please Select", value: local!rating, saveInto: { local!rating, a!save(ri!) } ), a!textField( label: "Feedback", labelPosition: "ADJACENT", required: true, value: ri!meetingData.postMeetingSummary, saveInto: ri!meetingData.postMeetingSummary, validations: { rule!OK_MMS_ER_textValidationRule( "Summary", ri!meetingData.postMeetingSummary, 500 ) } ) }, {} ) ) ) ) } ) ) }, secondColumnContents: {}, buttons: a!buttonLayout( primaryButtons: { a!buttonWidgetSubmit( label: if( and( not( isnull( ri!isCheckInTask ) ), ri!isCheckInTask ), "Check In", "Submit" ), style: "PRIMARY", confirmMessage: if( and( not( isnull( ri!isCancelTask ) ), ri!isCancelTask ), "Are you sure you want to cancel the meeting?", {} ), value: "", saveInto: { if( and( not( isnull( ri!isCheckInTask ) ), ri!isCheckInTask ), {}, { a!save( ri!cancel, false() ), a!save( ri!meetingData.sendRemindersDtTime, if( and( not( isnull( ri!isReadOnly ) ), ri!isReadOnly ), ri!meetingData.sendRemindersDtTime, if( and( not( isnull( ri!meetingData.sendReminders ) ), ri!meetingData.sendReminders ), apply( rule!OK_MMS_ER_getActualDtTime( ri!meetingData.meetingStartDtTime, _ ), local!sendRemindersTime ), null ) ) ) } ) } ) }, secondaryButtons: { if( and( not( isnull( ri!isCheckInTask ) ), ri!isCheckInTask ), {}, a!buttonWidgetSubmit( label: "Cancel", style: "DESTRUCTIVE", confirmMessage: "Are you sure?", value: true, saveInto: ri!cancel, skipValidation: true ) ) } ), validations: {} ) )