Skip to main content

Posts

Showing posts from July, 2015

How to create a validation rule in Salesforce

Validation rule is a filter or a criteria that validates the data that is pushed into an application and verifies if the data that has been entered is in accordance to the set standards. Example : Let's say, there is a field that is used to enter the Age of a Student. But per the organization rule, no student should be allowed to join the course if the age is not more than 25 years. So here you may write a validation rule saying that the Age field should not be more than 25. In case the age entered is more than 25, then the record is not allowed to be saved. You would see an error when you enter the age more than 25. Let me give you another example.  Say that there's a field to enter the Product code. And per the rule of the organization, the Product code should always start with PR. In case you enter any code other than the one that begins with PR, you would encounter an error. The benefits of Validation rules is that you can improve the quality of the data that is go...

Properties of the validation rule

The following are the Properties of a validation rule : Rule Name The name of the validation rule that you are creating. Its length cannot be more than 40 characters. Spaces and special characters are not allowed. Active  To make a rule active , ensure that the checkbox is checked. If unchecked , the rule will not work. Description : It accepts 255 characters and is used to describe the purpose of a validation rule. This is not a mandatory field, but writing a description would make the job easier in case you are troubleshooting later . Error Condition Formula It is here that you write the validation rule - the condition / expression that validates the data before allowing you to save the record. Error Message  In case the record that the user is attempting to save does not meet the requirements, the error message that is supposed to be triggered is written here. Error Location  You use this option to choose where you would want to show the error messa...

How to create dependent picklist in salesforce

Dependant Picklists are those the values of which depend on the chosen value of another field. Lemme tell you with a simple example. Let's say there are 2 Picklist fields -- Country and States. You might of come across such scenarios where if you choose a value , let's say India in the Country field and then move to the State field to choose the State, you would only see the states that belong to the chosen value- India . So you would not find states in the State field that belong to any other country . Here the value of the State field is dependent on the Country field. Here State field is called the Dependent field. How to create dependent picklist in salesforce Let's do it here : At first create 2 custom Picklist fields , following the summarized steps here :  Setup |[ Customize | Create ] | choose the object where you would want to create the Picklist | New | and then follow the steps to create the picklist. Now, after creating Country and the State Pic...

Custom List Views in Salesforce

Custom List Views in Salesforce A view is just a list of records pulled from any object to be displayed basing on certain parameters. Example : I have a lot of records in the Accounts object. But I do not want to see all the records. I just need to see a set of records basing on a City name. I would then create a view defining the filters like City = Texas and then it would return only the records of those Accounts where Texas is in the city field. In view, you can also filter the fields that you would want to display. Example : You have lot of customer related data like Name, Location, Year of establishment, and so on, about 30 fields. However, you may not need all this information to be shown in the view. You would then select the fields which you would want to be displayed and then only those fields , lets say Name , Location , to be displayed for all the customers who are in Texas. Steps to create a Custom View : Go to any object, lets say Accounts in our example. C...