-
How can I cover the code coverage for multiple conditions in IF statement in Salesforce?
Below is the code for class:
public class ControllerHelper
{
public static boolean validate (Case obj)
{
if((obj.field1 = 'Yes' || obj.field2 = 'Yes') && checkNullValue(obj.field3))
||
((obj.field4 = 'Yes' || obj.field5 = 'Yes') && checkNullValue(obj.field6))
)
return true;
else
{
return false;
}
}public static boolean checkNullValue(String value)
{
if(value==null || value.trim().length()==0)
{
return true;
}
return false;
}
}
Log In to reply.
Popular Salesforce Blogs
What Makes Teqfocus Your Perfect Salesforce Partner
When you ask yourself the question of which Salesforce company is the best in India and which company should you consider as the perfect Salesforce…
Territory Management In Salesforce
Steps To Enable Territory Management In Salesforce:- 1. Log in to your Salesforce org. go to Setup, enter Territory in the Quick Find box. 2.…
Landing Page Login Form And Save Data In Salesforce Data Extensions
As all we know, Salesforce Marketing Cloud is a tool that provides digital marketing automation and services and analytics software. And Landing page is an…
Popular Salesforce Videos
Customer Lifecycle Analytics | Salesforce
Customer Lifecycle Analytics, built on Tableau CRM, helps you glean even more value from your Salesforce Surveys and Salesforce Feedback Management responses with embedded analytics…
Good Time To Buy Salesforce Stock? CRM Stock Analysis
CRM stock price is currently all over after reporting its SALESFORCE earnings report. I am considering if I should buy CRM Stock. This is a…
Salesforce Tutorial For Beginners | Introduction To Salesforce | Salesforce Training
This video on Salesforce training will help you understand the easy and best tool for CRM and Branding. You will learn how to customize the…