@WarrenBelz - My sincere apologies, I will be sure to put the code as text.
NextButton.OnSelect
SubmitForm(ScreeningForm);
Reset(Status_Dropdown);
Reset(Reason);
Reset(Type);
Reset(EmergencyContact);
Reset(DatePicker2);
Reset(ProjectName_Dropdown);
Reset(ProjectNumber);
Reset(RoleDropDown);
Reset(PhoneNumber);
Reset(WorkerName);
Reset(CompanyName);
Reset(Emergency_Contact_Number);
Reset(office_jobsite);
Reset(office);
Reset(other_craft_field);
Reset(Non_Clayco_Dropdown);
Set(lastID,ScreeningForm.LastSubmit.ID);
Set(LastContactID,ScreeningForm.LastSubmit.ID);
ResetForm(ScreeningForm);
ResetForm(QuestionsForm);
If(Reason.Selected.ProductName="Travel" || ReasonView.Text= "Travel", Navigate(Travel_Info),Navigate('Screening Questions'));
Set(varMode,"New");
Refresh('[dbo].[COVID_Screening_Form]');
PersonalInfo-Screen.OnVisible (The form I have is on the same page but it is hidden and the fields are being referenced in the form.)
UpdateContext({varNon: "Non-Clayco",varOffice: "Office", varJobsite: "Jobsite"});
Set(statusVar,If(BrowseGallery1_1.Selected.status="true",true,false));
ClearCollect(Role,'[dbo].[COVID_Screening_Form]');
Reset(Status_Dropdown);
Reset(Reason);
Reset(Type);
Reset(EmergencyContact);
Reset(DatePicker2);
Reset(ProjectName_Dropdown);
Reset(ProjectNumber);
Reset(RoleDropDown);
Reset(PhoneNumber);
Reset(WorkerName);
Reset(CompanyName);
Reset(Emergency_Contact_Number);
Reset(other_craft_field);
Reset(office);
Reset(office_jobsite);
ResetForm(ScreeningForm);
If(varMode="Edit",EditForm(ScreeningForm),NewForm(ScreeningForm));
Clear(RecordsCollection);
UpdateContext({showPopup3:false});
Regarding the "Add Person" button, I was using a Patch and Collect statement but was told by Microsoft that it would be easier / better to use a different datasource to store the information that is being entered seperate from the first database and to just reference the first forms ID in a corresponding column on the second database.
AddPersonButton.OnSelect
/*ForAll(
Gallery1.AllItems,
If(IsBlank(MasterID),
Patch(
'[dbo].[COVID_Close_Contact_Form]',
Defaults('[dbo].[COVID_Close_Contact_Form]'),
{
Contact_Name: cc_Name.Text,
Contact_Company: cc_Company.Text,
Contact_Date: cc_Date.SelectedDate,
Contact_Duration: cc_Duration.Text,
Contact_Describe: cc_Describe.Text,
Contact_Created_By: Contact_Created_By,
MasterID: BrowseGallery1_1.Selected.ID
}
),
Patch(
'[dbo].[COVID_Close_Contact_Form]',
{MasterID:MasterID},
{
Contact_Name: cc_Name.Text,
Contact_Company: cc_Company.Text,
Contact_Date: cc_Date.SelectedDate,
Contact_Duration: cc_Duration.Text,
Contact_Describe: cc_Describe.Text,
Contact_Created_By: Contact_Created_By,
MasterID: lastContactID
}
)
));*/
SubmitForm(Contact_Tracing_Form);
Set(
successMessage,
"Contact Successfully added!"
);
Refresh('[dbo].[COVID_Close_Contact_Form]');
Reset(cc_Company);
Reset(cc_Date);
Reset(cc_Describe);
Reset(cc_Duration);
Reset(cc_Name);
Please let me know if you have any other questions and I will do my best to explain what the intended behavior is and what the actual behavior is.
Thanks again!