You need to sign in to do that
Don't have an account?
pooja biswas
validation rule to fire only during edit
Hi
I need to have a validation rule fire only when Lead object Email field is edited and not when inserted.
I did something like this on Lead object.
NOT(REGEX( Email ,'([a-zA-Z0-9_\\-\\.]+)@((\\[a-z]{1,3}\\.[a-z]{1,3}\\.[a-z]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})'))
so this works when a new Lead is inserted or edit and email not proeprly specified.
Now I did like this
NOT(REGEX( Email ,'([a-zA-Z0-9_\\-\\.]+)@((\\[a-z]{1,3}\\.[a-z]{1,3}\\.[a-z]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})')) && NOT(ISNEW())
but its not working.
Need help on this.
thanks
pooja
I need to have a validation rule fire only when Lead object Email field is edited and not when inserted.
I did something like this on Lead object.
NOT(REGEX( Email ,'([a-zA-Z0-9_\\-\\.]+)@((\\[a-z]{1,3}\\.[a-z]{1,3}\\.[a-z]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})'))
so this works when a new Lead is inserted or edit and email not proeprly specified.
Now I did like this
NOT(REGEX( Email ,'([a-zA-Z0-9_\\-\\.]+)@((\\[a-z]{1,3}\\.[a-z]{1,3}\\.[a-z]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})')) && NOT(ISNEW())
but its not working.
Need help on this.
thanks
pooja
AND(ISCHANGED(Email), NOT(ISNEW())) is working for me.
Actually you dont have to check the NOT(REGEX( Email ,'([a-zA-Z0-9_\\-\\.]+)@((\\[a-z]{1,3}\\.[a-z]{1,3}\\.[a-z]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})')) because email field throws that error if email is not in proper syntax. Standard validation is performed on it. Its working perfectly for me. If any problem, you can ask me. If working, please mark this as best answer
All Answers
try this out
NOT(REGEX( Email ,'([a-zA-Z0-9_\\-\\.]+)@((\\[a-z]{1,3}\\.[a-z]{1,3}\\.[a-z]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})')) && NOT(ISNEW()) && ISCHANGED( )
I tried but its not working.
I did like this also (Myvalidation rule) && NOT(ISNEW()) && NOT(ISCHANGED(Email )) but its not working.
Thanks
Pooja
AND(ISCHANGED(Email), NOT(ISNEW())) is working for me.
Actually you dont have to check the NOT(REGEX( Email ,'([a-zA-Z0-9_\\-\\.]+)@((\\[a-z]{1,3}\\.[a-z]{1,3}\\.[a-z]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})')) because email field throws that error if email is not in proper syntax. Standard validation is performed on it. Its working perfectly for me. If any problem, you can ask me. If working, please mark this as best answer
Thanks, I overlooked this .
Its working