cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pat_aus
Frequent Visitor

Check for Date Time Conflict

Hi,

 

I have setup a booking calendar for two resources cars and rooms. I have a two different forms that people use to book a resource I have put in a check to see if the Date and Time is already booked.

Both forms have the same code and use the same field types in Dataverse for Teams.

Both work if you book the whole day but only one works if you book on the same day with a time later then the last record

I'm a bit lost as to what is going wrong with one form when it works on another one fine when booking the same day but different times.

Any pointers would be great.

You can ignore the highlighted part I just put that in for some error checking.

6 REPLIES 6
pat_aus
Frequent Visitor

Sorry ignore CheckDateTime2.png the correct ones are below

v-albai-msft
Community Support
Community Support

Hi @pat_aus ,

Do you mean only one form works well when selecting with a different time?

If one form works well, I think your code is without any issue, so do you have any other different configurations between these two forms? 

From your code, I know you have a table called "Car Bookings", and for room bookings, do you have another table? If yes, have you changed the table name of the code inside rooms booking form?

 

Per my understand, if you want to create other new records with the different time in a same day, just need to check if the new selected time is among the time of existing record(usually check this in Submit button). 

If my understand is not correct, please let me know.

Best regards,

Allen

Hi,

 

Thanks for getting back to me, I checked the code and they are both identical but reference each table, the room one is the one that is working which is even stranger as I copied the code from the Car form which doesn't work.

 

I do have other Tables but the forms only relate to those two tables, I'm not using the submit form option instead using a Patch which works as I have a recurring option in the form.


I have a check button which runs the code in the attachments

Hi @pat_aus ,

I can't really think of any other possibilities. So strange about your issue.

Since I cannot get exactly data and structure of your app, I would suggest you submit a support ticket for further help. The support engineers there have more experiences and resources, so they can remote assistance to you. 

https://admin.powerplatform.microsoft.com/support 

Best regards,

Allen 

I created a collection of the dataverse table and used the collection with the filter and it works.

 

Not sure why filtering the dataverse table directly doesn't work and the collection does work

Hi @pat_aus ,

Do you have lots of records in your DataSource(more than 2000 records)? Maybe this issue is related to the network. 

Anyway, since you have found the workaround(use a collection instead),  you can mark your workaround reply as a solution. This will benefit other community members who stuck with the same question.

Besides, if you want to dig more to find the root cause, you can still submit a support ticket.  

Best regards,

Allen

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,576)