Ibn 'Umar (RA) reported Allah's Messenger (ﷺ) as saying: It is the duty of a Muslim who has something which is to be given as a bequest not to have it for two nights without having his will written down regarding it.
A hadith like this has been narrated on the authority of Nafi', who based his narrations of the words of Ibn 'Umar but with a slight variation of words.
Salim reported on the authority of his father (''Abdullah bin 'Umar (RA) ) that he (his father) had heard Allah's Messenger (ﷺ) as saying: It is not proper for a Muslim who has got something to bequeathe to spend even three nights without having his will written down with him regarding it. 'Abdullah bin 'Umar (RA) said: Ever since I heard Allah's Messenger (ﷺ) say this I have not spent a night without having my will (written) along with me.