-
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
Higher Education CRM: How Universities Use Salesforce for Admissions
The higher education sector faces mounting pressure to attract and retain students. According to the National Student Clearinghouse Research Center, undergraduate enrollment declined by 8%…
Passing Platform Developer II – MCQ made easy!
You hear it right! Now the Salesforce Platform Developer II exam is made more easy with realistic tasks and flexible deadlines (Actually no deadline, in other…
Top New Features in Spring’24 Release: Sales Cloud in Lightning
As a sales professional, staying up-to-date with the latest technology and features is crucial to ensuring success in your role. With Salesforce’s Spring ’24 release,…
Popular Salesforce Videos
How to Edit List View Filters in Accounts and Contacts Tabs | Salesforce
Watch this video to learn How to Edit List View Filters in ‘Accounts’ and ‘Contacts’ Tabs. If you find anything confusing or have any questions,…
Salesforce — How To Market Your Small Business
How can small businesses get the word out about what they do, and be strategic about it? Here are three important steps to consider when…
Custom Aura Feed Component | forceChatter:feed | Chatter in #Salesforce | Salesforce Tutorials
In this vlog I will create a custom aura feed component with two picklists to select Group and then based on the Group selection, select…