All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
We have already issued several Fataawa on the issue of the prostration for forgetfulness, so you could refer to the following: 83932 and 81875.
As regards whether one should prostrate for forgetfulness after finishing the Tashahhud and exalting the mention of the Prophet or after saying the Tashahhud but before exalting the mention of the Prophet, the answer is as follows:
The prostration for forgetfulness could be performed after finishing the Tashahhud and exalting the mention of the Prophet and other supplications or mention of Allaah, whether it is performed before concluding the prayer or after concluding the prayer. Some Hanafi scholars hold a different opinion, they are of the view that one should say the Tashahhud then the Tasleem (concluding the prayer), and then prostrate for forgetfulness and then say the Tashahhud and exalt the mention of the Prophet.
So according to Hanafis, first one should say the Tashahhud and the prayers upon the Prophet and then the Tasleem, after this he should prostrate for forgetfulness. Some of these scholars are even of the view that one should say the Tashahhud and exalt the mention of the Prophet and then prostrate for forgetfulness [before Tasleem], or say the Tashahhud and exalt the mention of the Prophet and conclude the prayer and then prostrate for forgetfulness. The most correct opinion, however, is what we have first mentioned that one should say Tashahhud and exalt the mention of the Prophet and other supplications and then prostrate for forgetfulness before concluding the prayer.
Allaah knows best.