The rule that comes into play is called sequencing.
SEQUENCING
While playing Warhammer 40,000, you’ll occasionally find that two or more rules are to be resolved at the same time – e.g. ‘at the start of the battle round’ or ‘at the end of the Fight phase’. When this happens during the battle, the player whose turn it is chooses the order. If these things occur before or after the battle, or at the start or end of a battle round, the players roll off and the winner decides in what order the rules are resolved.