Ubada bin Samit reported,

He said to his son, "My son, you will never taste the true essence 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 said, 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 of me.'"

Azami 992

Hasan

عن عبادة بن الصامت

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

الأعظمي 992حسن
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Belief in the divine decree and predestination
Section
First thing Allah created was the pen and He commanded it to write the measures of all things until the Hour is established
Numbering
Jami al-Kamil 992 (2nd edition)
Azami 992