Hello,
I have read some of the other posts on this where patch functions are interfereing with submit functions. However, I am only using a patch function when this error occurs, and I'm wondering if I'm using it incorrectly, perhaps you can help! My app logs what jobs operators are doing.
I have a form which I use submit form to create a record in sharepoint (to start the job). At the same time I patch some info to a separate data source (this seems to work fine) using the following function:
SubmitForm(Form_job_running);
Refresh('Production Database');
Patch('Production Database', First(Filter('Production Database',ID=Value(DataCard_jobID.Text))),
{
status: "Running",
Job_Start: Now()
}
);
UpdateContext({JobRunning:true});
Patch('Production Data Times',
{
Job_MO: label_jobmo.Text,
Start: Now(),
Job_ID: DataCard_jobID.Text,
job_pause_count: DataCardValue5_1.Text,
Operator: dropdown_user.Selected.Value
}
)Then when I want to pause the job I get the error (sometimes) using the following:
Patch('Production Data Times', First(Filter('Production Data Times',Job_ID=DataCard_jobID.Text, job_pause_count=DataCardValue5_1.Text,End=Blank())),
{End: Now(),
Operator: dropdown_user.Selected.Value
}
);
Patch('Production Database',First(Filter('Production Database',ID=Value(DataCard_jobID.Text))),
{
Description: DataCardValue22.Text,
Job_MO: label_jobmo.Text,
customer_part_num: label_custpartnum.Text,
Job_Type: Label_job_type_1.Text,
Booth_number: label_boothnumber_1.Selected.Value,
Cycles_Number: Value(DataCard_cycles_number.Text),
parts: Value(DataCardValue1_1.Text),
operators_total: Value(Dropdown1_1.Selected.Value),
status: "Paused",
overtime_hours: Value(DataCardValue9_1.Text),
reworked_parts: Value(DataCardValue14_1.Text),
Lab_Qualification_Number: DataCardValue15_2.Text,
cycletime_secs: Value(TextInput_cyclesecs_1.Text),
cycletime_mins: Value(TextInput_cyclemins_1.Text),
guntime_endhours: Value(TextInput_endgunhours_2.Text),
guntime_endmins: Value(TextInput_endgunmins_2.Text),
guntime_starthours: Value(TextInput_startgunhours.Text),
guntime_startmins: Value(TextInput_startgunmins.Text),
engineering_comments_checkbox: slider_engineering_comments.Value,
engineering_feedback: DataCardValue13_1.Text,
launchpad_checkbox: slider_launchpad_comments.Value,
job_pause_count: DataCardValue5_1 +1
}
);Please can you tell me if there's a better way to do this and how to avoid the error I'm getting? Should I be using the update function?
Thank you 🙂