Forum Discussion

PrashantMaheshw's avatar
PrashantMaheshw
Qrew Captain
2 months 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]
)

4 Replies

  • ben_simon's avatar
    ben_simon
    Community Manager

    This is great stuff, PrashantMaheshw ! How's it been working out so far? And would you have any interest in bringing your Showcase Series to Qrew Meet Ups? 

      • ben_simon's avatar
        ben_simon
        Community Manager

        Amazing, I'm going to send you an email with EstherLaVielle  to get this set up. Esther's currently on vacation, but once back I'm sure she would love to see the above and chat with you about presenting to The Qrew!