Good Morning,
I am having trouble figuring out how to validate data in a table.
I have built a timekeeping application.... The user has to select the week ending date for which they are entering their time. When the person selects the week ending date on a date picker i want to verify if the user already has a timesheet for that week ending in a Dataverse table. If the user indeed has a timesheet already for that particular week i want to display a notification stating "A timesheet already exists for that week ending go to edit timesheet instead.
Do i need to grab that data and put it in a collection ? Can it just verify by pointing to the actual table.... do i do a variable etc.....
Thank you all in advance!!!
No you! 😋
mmollet you are the man!!!!! It's working perfectly!!! Your time and responses is much appreciated.
based on your first response to me it seems like you need to add 2 closing parenthesis right after: BusinessDay_Datepicker.SelectedDate)), Notify(....
This is the updated code... with the error at the last parenthesis
Not 100% sure as the error popup is blocking the code a bit but that seems to be the case. Just make sure your lookup is closed after the 2nd condition where its hidden. If that is closed properly then you should check that the isblack call is closed properly next.
If you click near a parenthesis it will show you its 'partner' by highlighting both of them so you can have a little easier time tracking down what goes with what.
EDIT: based on your first response to me it seems like you need to add 2 closing parenthesis right after: BusinessDay_Datepicker.SelectedDate)), Notify(....
Sorry i forgot to add the .SelectedDate as you first indicated.
that seemed to fix the error but now I'm getting the following
Not sure if I'm missing a few more parenthesis
First thing is when you are referencing your datepicker you are referencing the control not its value. Here is an example. If you have a control named Control and you type into a label Control it will get confused as the type of Control cannot be resolved into a number or text b/c it is an object. What you are wanting is that controls value that it is holding. In your case with a datepicker you will want to use BusinessDay_DatePicker.SelectedDate instead. Let me know what this does after the change! 🙂
Thank you for your response!!!!
I am getting a few error messages. Please see images.
Also is this the correct way to nest two IF statements?
Seems like you should be able to just do a lookup into your SP list. If you have an item with the same name/employeeID And the same ending date then you can be sure that an entry for that week for that person is already done.
If(IsBlank(LookUp(SPListName, employeeID = [empIDToSearch] And WeekEndsOn = DatePicker.SelectedDate, Notify("already made etc...", NotificationType.Error), [patch the users entry as a new row])
WarrenBelz
146,605
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,946
Most Valuable Professional