formula and validation

Formula Field and Validation Rule in Salesforce

Formula and validation:

“Control of how your data is displayed.”

These rules confirm that the information a client enters in a record meets the benchmarks you indicate some time recently the client can spare the record.

Why To Use?

Numerous times we ought to control the values of the fields put away within the Salesforce question by applying many conditions or calculations. Users can get to and get it the information at-a-glance without doing a bunch of calculations in their heads.

dont miss out iconDon't forget to check out: Things to Consider Before Changing Field Data Type in Salesforce

Path to find:

From Setup -> Object manager -> Choose the object -> Fields and Relationship (left sidebar) -> Click “New” -> Select Formula

Equation- A read-only field that infers its esteem from an equation expression you define.

The formula field is upgraded when any of the source areas change.

Rollup Summary:

It calculates values from a set of related records. It displays a value on a master record based on the values of a record in a detail record.

Count- totals the number of related records.

Sum- totals the values in the field (number, currency,percent)

Min- lowest value(number, currency, percent, date, date/time)

Max- highest value(number, currency, percent, date, date/time)

Master-detail Relationship closely connected objects together so that the ace record controls particular behaviors of the detail and subdetail record. Diff- Whereas an equation calculates values from areas employing a single record, while rollup employs a set of related records.

Validation Rule:

Verifies that data can be saved.

Returns true or false

Error message

Made for objects, areas, campaign individuals or case milestones.

Using these rules effectively contributes to quality.

Avoid storing unnecessary data. One way of making a field mandatory.

Ex- Account number is numeric, date must be in the current year

dont miss out iconCheck out another amazing blog by Ayush here: Synchronous and Asynchronous calls using Apex in Salesforce


Character limit—Formula fields can contain up to 3,900 characters, including spaces, return characters, and comments. If your formula needs more characters, create separate formula fields and reference them in another formula field.

Save size limit—Formula fields can’t exceed 4,000 bytes when saved. The spare estimate is distinctive from the number of characters in the event that you utilize multi-byte characters in your equation.

Compile size limit—Formula fields can’t exceed 5,000 bytes when compiled. The compile size is the size of the formula (in bytes) including all of the fields, values, and formulas it references. There's no coordinate relationship between the compile estimate and the character limit. A few capacities such as Content, DATEVALUE, DATETIMEVALUE, and DATE altogether increment the compile measure.

Popular Salesforce Blogs