-
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
Wrapper Class in Apex Salesforce | The Developer Guide
Wrapper Class in Apex Salesforce Wrapper Class in Apex Salesforce: A wrapper or compartment radiance is a class, a realities shape, or a unique data…
How Can Salesforce Consulting Services Help Increase ROI?
With more than 150,000 companies employing Salesforce, there's no doubt that it's one of the top CRM tools on the market. With many businesses using…
How to do a Successful Marketing Cloud Personalization Implementation?
To personalize and manage real-time interactions with your customers, Salesforce Marketing Cloud Personalization is a potent tool. But you need to plan and execute it…
Popular Salesforce Videos
Salesforce Admin Interview Questions And Answers For Freshers & Experienced
This Salesforce Admin Interview Questions and Answers video includes all the frequently asked Interview questions that give you an idea to crack your Salesforce Admin…
Quick Text in Salesforce | Service Cloud | Salesforce Tutorial
In this video, we will talk about what is Quick text and how to implement those Quick texts inside Salesforce. Watch the video and let…
Salesforce Business Analyst Training
In the 35th Episode of the #AskTheHulk series, Savitha Asked about how to switch to IT from Non-IT background. To this question, Shrey suggested that…