Using this code from a dropdown "OnChange" event.
I'm still having an issue on the IF statement.
this part:
//action1
If(!IsBlank(LookUp('[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]', Status = "Open" && lbl_Racfid_ms.Text = ID_Racfid)),
//condition
Notify("Check A Row for Open Status !", NotificationType.Warning,4000),
I need to exit out of the if statement if this part is true...
It is still proceeding and processing this part ?
//result2
dwn_ChangeStatus.Selected.Value = "Open",
//condition3
Patch('[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]',LookUp( '[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]', NSC_Id = Value(txt_NextId.Text)),{Status:"Open"});Set(gblUnsaved, true);
Set(TheVar,Now());Reset(dwn_ChangeStatus);Set(varCSPSALES, "YES");
Notify("You Have Opened a Task !", NotificationType.Warning,4000)
Set(lastActivityTime, Now());
//action1
If(!IsBlank(LookUp('[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]', Status = "Open" && lbl_Racfid_ms.Text = ID_Racfid)),
//condition
Notify("Check A Row for Open Status !", NotificationType.Warning,4000),
//result1
UpdateContext({varDate: Now()});UpdateContext({varValue: ""});
//result2
);
//action2
If(dwn_ChangeStatus.Selected.Value = "In Progress",
//condition1
Set(varCSPSALES, "NO");Patch(
'[dbo].[t_nsc_trackcode_trans_time_entry_pa]',
Defaults('[dbo].[t_nsc_trackcode_trans_time_entry_pa]'),
{
NSC_ID_Ref: Value(txt_NextId.Text),
opened_at: DateTimeValue(txt_ReOpenedDate.Text),
inprogress_or_closed_at: varDate //Now()
}
);Patch('[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]',LookUp( '[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]', NSC_Id = Value(txt_NextId.Text)),{Status:"In Progress"});Reset(dwn_ChangeStatus),
//result1
dwn_ChangeStatus.Selected.Value = "Closed" ,
//condition2
Set(varCSPSALES, "NO");Patch(
'[dbo].[t_nsc_trackcode_trans_time_entry_pa]',
Defaults('[dbo].[t_nsc_trackcode_trans_time_entry_pa]'),
{
NSC_ID_Ref: Value(txt_NextId.Text),
opened_at: If(tbl_Tasks.Selected.Status = "In Progress" ,varDate,tbl_Tasks.Selected.Status = "Open",DateTimeValue(txt_ReOpenedDate.Text)),
inprogress_or_closed_at: varDate//Now()
}
);Patch('[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]',LookUp( '[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]', NSC_Id = Value(txt_NextId.Text)),{
Status:"Closed",
Closed_Date:varDate//Now()
}
);Notify("Task Has Been Closed !", NotificationType.Warning,4000);Reset(dwn_ChangeStatus),
//result2
dwn_ChangeStatus.Selected.Value = "Open",
//condition3
Patch('[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]',LookUp( '[dbo].[t_nsc_trackcode_assigned_DataEntry_pa]', NSC_Id = Value(txt_NextId.Text)),{Status:"Open"});Set(gblUnsaved, true);
Set(TheVar,Now());Reset(dwn_ChangeStatus);Set(varCSPSALES, "YES");
Notify("You Have Opened a Task !", NotificationType.Warning,4000)
//result3
);
//action3
