What is the ruling on exiting the mosque during the khutbah on Friday?
Question

What is the ruling on exiting the mosque during the khutbah on Friday to answer a phone call that I thought was urgent? Does it invalidate the prayer? Please note that I acted without thinking, and I did not know the ruling on this action, which took me by surprise.
Praise be to Allah.Firstly:
What is required of the one who attends Jumu‘ah is to listen attentively to the imam whilst he is delivering the khutbah, and it is not permissible for him to speak to anyone else. An exception is made for speaking to the imam, or for the imam to speak with the members of the congregation, in the case of an urgent matter or for a purpose.
Please see the answer to question no. 45651 .
There is nothing wrong with making a slight movement for a valid reason, so long as it is not fidgeting, during the khutbah on Friday, such as turning off one’s mobile phone, for example.
Please see the answer to question no. 119636 .
Secondly:
It is not permissible to exit the mosque during the khutbah except in the case of an emergency, such as saving one who is drowning, or saving a child from death, or putting out a fire, or coming to the aid of one who is in desperate need, and other necessary reasons for which it is permissible to interrupt the prayer.
What you should do is turn off your phone when you enter the mosque for Jumu‘ah prayer, from the time when the khatib comes out until the prayer is over.
If it so happens that you forgot, you should not speak on your phone to anyone, just as you should not speak to anyone else during the khutbah on Friday.
If it so happened that you spoke to someone, whether that was inside the mosque or you exited the mosque to speak on the phone, then you have transgressed the prohibition on speaking when the imam is delivering the khutbah, and you incurred sin as a result and cancelled out the reward of Jumu‘ah by engaging in this idle speech, even though you are not required to repeat the prayer.
Abu Dawud narrated from ‘Abdullah ibn ‘Amr ibn al-‘Aas, from the Prophet (blessings and peace of Allah be upon him), that he said: “Whoever does ghusl on Friday, and puts on some of his wife’s perfume if she has any, and puts on some of his good clothes, then does not step over people’s necks and does not engage in idle talk during the exhortation [of the imam], it will be an expiation for whatever occurred between them [the two Fridays]. But whoever engages in idle talk and steps over people’s necks, it will count as Zuhr for him.
Al-Hafiz said: Ibn Wahb, one of the narrators of this report, said: What is meant is that his prayer is valid, but he will be deprived of the virtue of Jumu‘ah."(Fath al-Bari  2/414).
‘Abd ar-Razzaaq (5420) narrated from the Prophet (blessings and peace of Allah be upon him) that he said: “Whoever engages in idle talk, there is no Jumu‘ah for him.” There is corroborating evidence for this report; it was classed as sahih by Al-Albani in al-Ajwibah an-Nafi‘ah (p. 105).
Shaykh Ibn ‘Uthaymin (may Allah have mercy on him) said: What is meant is that he will be deprived of the reward of Jumu‘ah; it does not mean that his Jumu‘ah is not valid."(Fatawa Nur ‘ala ad-Darb  8/2).
And Allah knows best.