• Anjali Ronnie
  • NEWBIE
  • 0 Points
  • Member since 2023

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

trigger TaskAssignmentTrigger on Claims__c (before insert, before update) {
    List<Id> assignedUserIds = new List<Id>();

    for (Claims__c claim : Trigger.new) {
        if (claim.Assigns_to_be__c != null) {
            for (Assignment_Group_c__c membership : claim.Assigns_to_be__c) {
                assignedUserIds.add(membership.Users__c);
            }
        }
    }

    if (!assignedUserIds.isEmpty()) {
        TaskAssignmentHandler.addUsersToTask(assignedUserIds, Trigger.new[0].Id);
    }
}

 

Im getting an error "Loop must iterate over collection: Id". Dont know what is causing this error.Any help will be much apprecitated.