Abdullah bin Amr bin As reported,

The Prophet ﷺ said, "There is no Muslim who is afflicted with a trial in his body except that Allah Almighty commands the angels who guard him, saying, 'Write down for My servant each day and night the same good deeds he used to perform, as long as he remains held in My bond.'"

Ahmad 6870

Sahih

حدثنا عبد الرزاق أخبرنا سفيان عن علقمة بن مرثد عن القاسم بن مخيمرة

عن عبد الله بن عمرو قال

قال النبي ﷺ ما من أحد من المسلمين يصاب ببلاء في جسده إلا أمر الله تعالى الحفظة الذين يحفظونه قال اكتبوا لعبدي في كل يوم وليلة مثل ما كان يعمل من الخير ما دام محبوسا في وثاقي

أحمد 6870صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Abdullah bin Amr bin As
Numbering
Darussalam 6870
Ahmad 6870