In this blog, we will learn how to hide/show a particular field based on the view’s condition. We can do this by using business rules.
Here Contact is an entity. Is Product (Yes/No), Product Detail these 2 are fields of contact. if the contact has a product, show the product detail else, hide the product detail. Is Product field will be Yes if the contact has a product otherwise, it will be false.
Below are the steps to create a business rule to hide/show product detail.
Step 1: Navigate to Settings > Customization > Customize the System.
- Click on Customize the System; it will open a pop-up.
Step 2: Click on Entity and open Contact entity. And click on the Business Rules to create a new one.
Step 3: Configure the Business rule.
- Business Rule: Give a proper name to the business rule.
- Description: Write an appropriate description of the business rule.
A. First we will check whether Is Product is True or False. So for that, click on Condition in the properties and set a property that if Is Product is true.
- Display Name: Write the display name of the condition.
- Entity: Select contact entity.
Now set the rule.
- Source: Select Entity.
- Field: Select the field on which you want to check the condition here, we choose Is Product.
- Operator: Select Equal
- Type: Select Value
- Value: Yes (Provide the value of the field)
Now click on Apply. It will look like the below image.
- Now set action if the condition is true or false.
- So if Is Product is true, then set the action to show product detail, and if Is Product is false, then hide Product detail.
B. Drag Action (Set Visibility) to the correct and cross icon as highlighted in the below image.
Now Set Visibility in both cases of Is product is true or false.
i) If the Product is true, show product detail
- Set visibility as shown in the below image and click on Apply.
ii) If the Product is false, hide the product detail
- Set visibility as shown in the below image and click on Apply.
So after setting conditions and actions, it will look like as below.
C. Save and Activate the business rule.
Now on every record of contact based on condition, it will hide/show the product description.
So this is how users can create business rules to hide/show particular fields based on any conditions.
All product and company names are trademarks™, registered® or copyright© trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.