/* THIS IS THE START OF THE PATCH FUNCTION THAT WILL PATCH DATA TO ASSOCIATED SHAREPOINT LIST COLUMNS */
Set(
varCurrentCoachingRequestRecord,
Patch(
'LiveWest Coachees',
varCurrentCoachingRequestRecord,
{
// THIS WILL PATCH BASIC TEXT DATA TO SHAREPOINT LIST
'Who was your coach?': WhoWasYourCoach_txt.Text,
'Who provided your coaching?': WhoProvidedTheCoaching_txt.Text,
'Is there anything else we need to know?': AnythingElse_txt.Text,
'Third party name': '3rdPartyName_txt'.Text,
'Third party contact details': '3rdPartyContact_txt'.Text,
'Department/Team': Department_txt.Text,
// THIS WILL PATCH YES/NO COLUMNS TO SHAREPOINT LIST
'Have you used coaching before?': HaveYouUsedCoachingBefore_tgl.Value,
'Was this coaching provided at LiveWest?': WasThisCoachingProvidedLiveWest_tgl.Value,
'Line Manager aware of application?': LineManagerAware_tgl.Value,
'Do you require information to be shared with a third party?': Share3rdParty_tgl.Value,
// THIS WILL PATCH COMPLEX CHOICE DATA TO SHAREPOINT CHOICE COLUMNS
'How did you hear about coaching in LiveWest?': {Value: HowDidYouHearCoaching_dd.Selected.Value},
'What do you want the coaching to help you with?': WhatDoYouWantCoachingtoHelpWith_combo.SelectedItems,
Location: AreasTravelTo_combo.SelectedItems,
ProvidingFeedbackToOthers_1: ProvidingFeedbackToOthers_1.Selected,
IncreasingSelfAwareness_1: IncreasingSelfAwareness_1.Selected,
CareerProgression_1: CareerProgression_1.Selected,
ProvidingFeedbackToOthers_2: ProvidingFeedbackToOthers_2.Selected,
IncreasingSelfAwareness_2: IncreasingSelfAwareness_2.Selected,
CareerProgression_2: CareerProgression_2.Selected,
'How many hours each month can you commit to meeting your coach?': CommitRegularMeetings_rdo.Selected,
TeamsVideoSession: TeamsSession_YesNo.Selected,
TelephoneSession: TelephoneCoaching_YesNo.Selected,
OfficeSpaceF2FSession: OfficeSpace_YesNo.Selected,
TravelF2FSession: TravelFaceToFace_YesNo.Selected,
// THIS WILL PATCH PEOPLE COLUMNS
Title: CoacheeName_txt.Text,
// THIS WILL PATCH DATE COLUMNS
'When did you last receive coaching?': WhenDidYouLastReceiveCoaching_date.SelectedDate
}
)
);
// THIS WILL CHECK FOR ERRORS
If(
IsEmpty(Errors('LiveWest Coachees')),
// ON SUCCESS
UpdateContext({locFormDisplayMode: "View"}); //
Notify(
"Success: Uniform Order Form Submitted",
NotificationType.Success
),
// ON FAILURE
Notify(
"Errors: Unable to Submit Uniform Order Form",
NotificationType.Error
)
);
// THIS WILL RESET ALL FIELDS WHEN THE FORM HAS BEEN SUBMITTED */
// CLEAR VARIABLES
Set(varCurrentCoachingRequestRecord, Blank());
UpdateContext({locFormDisplayMode: Blank()});
// RESET CONTROLS
Set(varResetthemAll, true);
Set(varResetthemAll, false);
/* THIS WILL NAVIGATE THE USER TO THE SUCCESS SCREEN */
Navigate(Home_scrn,ScreenTransition.Fade)