The ISCHANGED function in Salesforce is used to check whether a specified field has been modified.
The Salesforce ISCHANGED function in Salesforce is one of the powerful functions of Salesforce that is used to manage and customize the data effectively.
As a Salesforce Administrator, I will explain to you the ISCHNAGED function with its syntax, use case, consideration, and more. I will also guide you step-by-step on how to use the ISCHANGED function in Salesforce Lightning and Salesforce Classic.
ISCHANGED Function in Salesforce
What is the ISCHANGED Function in Salesforce?
The ISCHANDED function in Salesforce is one of the Salesforce Advanced functions that is used to manage and track the fields and their updates in Salesforce org.
It is the function that is used to determine whether a specified field has been modified. The function compares the value of a field to the previous value, and if the values are different, the function returns TRUE, but if the values are the same, this function returns FALSE.
What is the syntax to write the ISCHANGED function in Salesforce?
The syntax of the ISCHANGED function is given below:
ISCHANGED(field)
field: The field parameter specifies the field you want to monitor for changes or the name of the field you want to compare.
Why ISCHANGED function not available while creating the formula field?
The Salesforce ISCHANGED function is not available while creating the formula field because you can not use the functionality of the function in the formula fields.
The function is available in Salesforce assignment rules that are used for assigning records based on defined criteria. It is also available in validation rules that evaluate whether a specified field has been modified.
Additionally, while configuring field updates, the ISCHANGED is commonly used to automate field updates. The function is available in workflow rules with the specified evaluation criteria.
Moreover, the ISCHANGED function is available in the formula criteria for executing actions in Process Builder.
When utilizing Salesforce’s ISCHANGED function, are there any anything we need to keep in mind?
Yes, there are a number of things to keep in mind while using the Salesforce ISCHANGED function. The considerations are given below:
If you use the NOT function in Salesforce, it reverses the logical value of a Boolean expression. It returns TRUE if the expression is FALSE, and vice versa.
The ISCHANGED function returns FALSE when evaluating any field on a newly created record.
The function returns TRUE when a text field was previously blank and now contains any value.
For the number, percent, or currency field, the ISCHANGED function returns TRUE in the following case:
- When the number field was previously blank and now contains any value.
- When the number field was previously zero and now is blank.
- When the number field was previously zero and now contains any value other than zero.
With this, you have learned about the syntax, usage cases, and considerations of the ISCHANGED function in Salesforce.
How to use the ISCHANGED Function in Salesforce Lightning
Use the following steps to use the ISCHANGED function in Salesforce Lightning. Let’s clear it up with the help of a small scenario:
Scenario: You want to create the validation rule in Salesforce that checks on the contract term are changed, a future end date is provided, and if the status is not active raise an error.
1. Log in to your Salesforce account as an administrator with your credentials. If you are not on the “Main Setup”, locate and click on the “Gear” icon in the top-right corner of the page to access the setup menu by choosing the “Setup” option from the dropdown.
2. On the main setup page, find and click on the “Object Manager” tab given at the navigation bar.
Now, select the Salesforce object for which you want to create the validation rule. According to the scenario, you need to choose the “Contract” object.
