Hide "Add" button after a certain time of the day

Hello everybody! 

I'm trying to have some sort of a condition that hides the "Add" buttton on a table after 4:30pm. Is  this possible? 

The ideia is to block data entry after a determined hour of everyday. 

Thank you for your help. 

Kind regards. 

Solved Solved
0 6 119
1 ACCEPTED SOLUTION

You can use TIMENOW()<"16:30:00" but it needs a sync (or like add, edit etc.) before it's recalculated. 

View solution in original post

6 REPLIES 6

You can use TIMENOW()<"16:30:00" but it needs a sync (or like add, edit etc.) before it's recalculated. 

What if I force a sync everytime someone tries to use the "add" button? This way I can get the app to sync and check if it is still possible to add/edit data. 

That's one possibility.. when the time is somewhere near. If the app is used regulary/often, then it would happen automatically. Another way is to show a warning on a form view that you are not able to add a record because... With this way the app doesn't need to sync everytime when it's not needed.

Capture the date/time on your form for the entry...you could hide the field and set an initial value of NOW() for that field...or you could set the Editable If value to FALSE if you want to show the field as well (we don't want the user to be able to modify the value that is preset).

Then, set a ValidIF condition for that field that makes sure the value is within the range you require.

Presto!  The user cannot save the entry after your prescribed Valid IF check.

Now of course should the user modify the system time of the device they are using to add the entry...

I've applied the solution given by @AleksiAlkio since my app will be sync very often.  Its super simples and effective. 

If you want a "foolproof" solution I advised you to use the solution given by @scott192 . 

Thank you both for your great suggestions!!! 

You're welcome!

Top Labels in this Space