• dattaraj1.3941931834289702E12
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hello,

 

I have some code that iterates through a list of Project_Role__c records and if the role__c field is null, remove it from the list.

 

Here is the code I have so far:

 

for(Integer j = 0; j < roles.size(); j++){
   if(roles.get(j).role__c == null){
        roles.remove(j);
   }
}

 For some reason the logic isn't working. 

 

*Note: Role__c is a picklist, should I be checking to see if Role__c == '' instead?