Welcome SDFC4STUDENTS Learner,
Today we will learn how to we can validate a record before saving it if the value is not in the proper way.
Requirement - Validate a record if the 'Account Number' field has less than 8 characters. This example is so easy to understand for the beginner. Let's start.
1. From
the list of Objects, click Account (You can select any Object where you want to
validate a field).
2. Click
the Validation Rules section from the left navigation then Click the “New” button
as shown below.
3. You will get this window. Use the functions and create your validation formula.
Here
is a brief description of the fields:-
a) Functions = According to your condition you can
use Function for any condition.
b) Insert Selected Function = You can use the LEN Function from
the Insert Selected Function to check the character length.
c) Formula Area = This formula box is where inside this you can create
any formula.
d) Insert Field = The Insert Field button opens a menu
that allows you to select fields to use in your formula. Inserting from this
menu automatically generates the correct syntax for accessing fields.
e) Insert Operator = The Insert Operator button opens a drop-down
list of the available mathematical and logical operators.
f) Check Syntax = Once you’ve written the formula for validation, you
can use the Check Syntax button to ensure that everything is in working order
before saving. LEN your formula has issues, the syntax checker alerts you to
specific problems.
g) Error Message = According
to your formula (G) whenever you will save the
record then it will show the error (Either ‘Top of Page’ or ‘Field’).
h) Top of Page and Field = This error
message can either appear at the top of the page or below a specific field on
the page.
i) Active
= If you want to fire the Validation on the record to save time then you must check this checkbox.
3. Click
Save (If you want to create multiple fields then you can click the button “Save
& New”).
4. Here is the final result, when you will save the record but the digit will only be 3 or less than 8 digits then it will show you the error.
Thanks for your given time guys, I am sure that it will
helpful for beginners.
No comments:
Post a Comment