It was narrated from Anas bin Malik that the Prophet (ﷺ) was given glad tidings that a need of his had been met, and he fell down prostrate.
Brief Explanation
1؎ : From this hadith it is understood that when a person experiences happiness, he should perform a prostration of gratitude (sajdah shukr), just as when the Prophet sallallahu alayhi wa sallam received glad tidings, he performed a prostration of gratitude.
Explanation & Benefits
Maulana Ataullah Sajid
Benefit:
On any occasion of happiness, it is Sunnah to perform a prostration (sajdah) to express gratitude to Allah.
This prostration can also be quite lengthy.
Source: Commentary on Sunan Ibn Mājah by Mawlānā ‘Atā’ullāh Sājid, Page: 1392