function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ishesh somani 6ishesh somani 6 

When can a validation rule be used to prevent invalid data

a.            When records are edited by a user
b.            When records are deleted by a user
c.             When records are submitted using web-to-lead
d.            When records are imported
e.            When records are updated by a workflow rule
 
Best Answer chosen by ishesh somani 6
NagendraNagendra (Salesforce Developers) 
Hi Ishesh,
  • When records are imported - Whenever data is imported into salesforce database there is every possibility that invalid data might enter into the org.By using validation rules we can prevent it.
  • When records are edited by a user - If a user is updating any records user might know or might not know what kind of information needs to be entered into the fields.So validation rule can be used here to prevent  invalid data.
  • When records are updated by a workflow rule: If any records are being updated by workflow rule as a part of automation data is entered automatically and stored into the database.Hence we can use validation rule here.
Please check with below link question number - 27 for same.
Mark this as best answer if it's resolved.

Best Regards,
Nagendra.

All Answers

NagendraNagendra (Salesforce Developers) 
Hi Ishesh,
  • When records are imported - Whenever data is imported into salesforce database there is every possibility that invalid data might enter into the org.By using validation rules we can prevent it.
  • When records are edited by a user - If a user is updating any records user might know or might not know what kind of information needs to be entered into the fields.So validation rule can be used here to prevent  invalid data.
  • When records are updated by a workflow rule: If any records are being updated by workflow rule as a part of automation data is entered automatically and stored into the database.Hence we can use validation rule here.
Please check with below link question number - 27 for same.
Mark this as best answer if it's resolved.

Best Regards,
Nagendra.
This was selected as the best answer
Siddhant SharmaSiddhant Sharma
Hi Ishesh and Nagendra,

The answer to your question will be a, c and e 

When records are edited by a user, or when imported or when submitted via using web-to-lead.

For more information, please look in the following link:

Validation Rule Consideration (https://help.salesforce.com/articleView?id=fields_validation_considerations.htm&type=0)


Thanks,
Mark this as best answer if it's resolved. or feel free to ask if still in doubt :)
Kevin (Jia ) LiuKevin (Jia ) Liu
Hello,
a c d

"updates to records based on workflow rules and also on process scheduled actions don’t trigger validation rules, workflow rules and some processes can invalidate previously valid fields."
therefore e was wrong
Regards
Siddhant SharmaSiddhant Sharma
Hey thanks for correcting Kevin !! I chose the wrong option but put the right ones in words . My bad! 
Kevin (Jia ) LiuKevin (Jia ) Liu
Hi Siddhant, 
You did great, no need to appologize 
Best,
Kevin
Pratidnya MorePratidnya More
Hello,
The correct options are:
  •  When records are edited by a user
  •  When records are imported
  •  When records are submitted using web-to-lead
Salesforce runs validation  rules before it creates records submitted via Web-to-Lead and Web-to-Case  and then creates records that have valid values.
 
Workflow rules and some processes can invalidate previously valid fields. Invalidation occurs because updates to records based on workflow rules and also on process scheduled actions don’t trigger validation rules.

Pratidnya More
Aiprous Technologies Pvt. Ltd.
 
Gabrielle HowellGabrielle Howell
But in that helpful link, it says "Salesforce runs validation rules before it creates records submitted via Web-to-Lead and Web-to-Case and then creates records that have valid values."  Ergo........  Imported, User, and Workflow Rules, correct??