You need to sign in to do that
Don't have an account?

Checking for empty fields
new to apex coding and wondering how I can check if a field in a custom record is empty? Particulary, I want to know what the "if condition" in apex code looks like for "integer" and "string"data types.
If(nameOfField__c == null){
//Your code
}
Regards,
Satish Kumar
you can use in this way
//For string fields
if(yourCustomStringField__c != '' && yourCustomStringField__c != null) {
//your logic here
}
//For Integer field
for(integerFied__c != null) {
//You logic here
}