Forum Discussion

PrashantMaheshw's avatar
PrashantMaheshw
Qrew Captain
23 hours ago

[Snippet] How we Stop Backdating Entries from user

Starting a new series on sharing some knowledge.

We have a simple app where we ask users to do production entries from shop floor daily in date , capturing it in [Production Date]

We only wanted backdated entries for 1 day , so if today is 21 February 2025, entry for 20 Feb 2025 is allowed. 

Here's how we achieved it. Below is a Formula Field called Validations. 

var date decide = If(IsNull([Record ID#]),Today(),ToDate([Date Created]));
var number daydiff= ($decide-[Production Date])/Days(1);

If($daydiff<0,"You cannot do entry for future",
$daydiff>1,"You cannot do entry for past","OK")

We then went to Settings->Advance Settings-> Custom Rules - Turn ON

If(
[Validation]<>"OK",[Validation]
)