AND(CreatedBy.UserRoleId = "00Ej0000001ITtG",
ActivityDateTime < NOW(),
CreatedDate = NOW())
If I take the third criteria out, an event with a start/end date in the past can be created, but then I get the validation when I edit it. How can I set it up so it stops the event from being inserted?
2 respuestas
Hello Micah, you can use this:
AND(
ISNEW(),
$UserRole.Name = "Role Name",
ActivityDateTime < NOW(),
)
- ISNEW() function ensures that the rule only fires on new records.
- The only other piece of advice I have for you is to always use Name/Developer Name (API) for the field names instead of harcoding ID's since ID's change between environments and that can cause serious issues post deployment.
Jsut my 2 cents.