Sayyiduna Ibn Abbas (may Allah be pleased with them both) narrates that when the Thursday came, and what a Thursday it was! Then he wept and said: The Messenger of Allah (peace and blessings be upon him) said: "Bring me a tablet and an inkpot, so that I may write for you a document after which you will never go astray." Some of those present said: The Messenger of Allah (peace and blessings be upon him) is speaking incoherently (from the severity of illness). Then they fell silent and he (peace and blessings be upon him) also fell silent. They said: O Messenger of Allah, shall we not bring it to you later? He (peace and blessings be upon him) said: "After what (has happened, what use is it)?"
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 12209