Ubada bin Samit reported,

"My son, you will never taste the true reality of faith until you know that what has befallen you could never have missed you, and what has missed you could never have befallen you. I heard the Messenger of Allah ﷺ say, 'The first thing Allah created was the Pen. He said to it, Write.It asked, My Lord, what shall I write?He said, Write the decrees of all things until the Hour arrives.'My son, I heard the Messenger of Allah ﷺ say, 'Whoever dies upon other than this is not from me.'"

Azami 8195

Hasan

عن عبادة بن الصامت أنه قال لابنه

يا بني إنك لن تجد طعم حقيقة الإيمان حتى تعلم أن ما أصابك لم يكن ليخطئك، وما أخطأك لم يكن ليصيبك. سمعت رسول الله ﷺ يقول: إن أول ما خلق الله القلم، فقال له: اكتب. قال: رب، ماذا أكتب؟ قال: اكتب مقادير كل شيء حتى تقوم الساعة. يا بني إني سمعت رسول الله ﷺ يقول: من مات على غير هذا فليس مني.

الأعظمي 8195حسن
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Beginning of creation
Section
Allah created the pen after the Throne and the water
Numbering
Jami al-Kamil 8195 (2nd edition)
Azami 8195