I have two bool checkboxes in the UI. At least one user is assigned to any of the fields. So when deleting the user, it has to check at least one user is checked with that fields or not.
Note: It's not mandatory that only single user is assigned to both check box fields. But for a checkbox, at least one user should be assigned.
If at least 1 user is available for that checkbox field, then we can give permission to delete the other user who is having the same fields.
Look at below code what I have tried:
1) When deleting the 2nd user having assigned with that field it gives me this message which is not correct validation. Because already 1 user is there, so we can delete the 2nd user.
2) If I write like countOfContractors < 1 and imagine only 1 user is having assigned with both fields, if I delete that user, 1<1 is false so it will be deleted. but it should not be deleted when 1 = 1.
What I have tried:
If (countOfcontractors<= 1) Then
confirmationMessage.Text = "At least one other user in the system must be made a Contractor before deactivating this user as a Contractor."
Exit Sub
End If