Locking period to create a record upto 3 days (Backdated)

Hi Folks,

Business have comeup with new requirement: They don’t want to create a lead up to 3 days (backdated) like if today is 17 September, so a salesperson can create a lead till September 14, not before that.
So they want a locking period upto 3 days, can it be achievable?

Many thanks!

Sorry, I don’t understand which date you mean. When I look at the Lead creation screen, I don’t see a field for Date. I know it will get a date attributed in the Database, but that is not changeable by the user.

Unless you added that field to the Edit view, is that it? Or is another custom field you introduced?

Any way, if you do need the field to be on screen, you need to follow some web tutorial to inject javascript into the view, to take care of the validation for you.

An easier way to implement this (though less elegant) is to make a workflow for Lead creation, saying: “if date is older than 3 days ago, set date to 3 days ago”.

Yes, I am aware that lead generates on system date, but due to business requirement we have to add a new date field on Lead Page and business has a requirement that sales team can’t create a lead in system in backdate (allow upto 3 days max).

I guess I need to make changes in backend and inject with some JS, because workflow won’t be a good practice.

Many thanks!

This might be a start

Example of Injecting code into Edit view for validation

I am not sure that is working 100%, but it can serve as a basis for you to Google for similar examples. Good luck, and please share what you come up with.