I have asked this before, but still not working.
I have a screen.
I have a table - "tbl_Tasks"
I have a dropdown - dwnChange_Status - Text = ["Open", "Closed", "In Progress"]
What I need:
I need to make sure a person cant put 2 rows to an "Open" Status. if they choose "Open" in the dropdown. and another row in the data already has a task in "Open" status.
The code continues to execute even after he Notify. I want it to exit the formula ?
For the "OnChange" event: i have:
Set(lastActivityTime, Now());
If(
!IsBlank(LookUp('[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]', Status = "Open" && lbl_Racfid_ms.Text = ID_Racfid)),
Notify("A Task is Already Open !", NotificationType.Warning,3000)
);
// otherwise lbl_OpenTasks_chk = 0 then perform code
UpdateContext({varDate: Now()});UpdateContext({varValue: ""});
Patch('[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]',LookUp( '[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]', NSC_Id = Value(txt_NextId.Text)),
{
Status:dwn_ChangeStatus.Selected.Value}
);
If(dwn_ChangeStatus.Selected.Value = "In Progress",
Patch(
'[dbo].[t_nsc_trackcode_trans_time_entry_pa]',
Defaults('[dbo].[t_nsc_trackcode_trans_time_entry_pa]'),
{
//NSC_Id_Time: IsNumeric(txt_NextId.Text),
NSC_ID_Ref: Value(txt_NextId.Text),
opened_at: DateTimeValue(txt_ReOpenedDate.Text),
inprogress_or_closed_at: Now()
}
));
If(dwn_ChangeStatus.Selected.Value = "Closed" ,
Patch(
'[dbo].[t_nsc_trackcode_trans_time_entry_pa]',
Defaults('[dbo].[t_nsc_trackcode_trans_time_entry_pa]'),
{
//NSC_Id_Time: IsNumeric(txt_NextId.Text),
NSC_ID_Ref: Value(txt_NextId.Text),
opened_at: Now(),
inprogress_or_closed_at: Now()
}
));
If(dwn_ChangeStatus.Selected.Value = "Open",Set(TheVar,Now());
Reset(txt_ReOpenedDate));
If(dwn_ChangeStatus.Selected.Value = "Open",Set(varCSPSALES, "YES"));
If(dwn_ChangeStatus.Selected.Value = "Closed",Set(varCSPSALES, "YES"));
If(dwn_ChangeStatus.Selected.Value = "In Progress",Set(varCSPSALES, "NO"));
This code only works one time, because if a person tries to change the "Status" from "Open" to "In Progress" it catches the check again and will not allow me to change another row again.
Thanks
Dave
