The transfer of the Imamate to the next Holy Imam has to occur at the death of the previous Holy Imam, and the transfer of the Imamate of Imam Hussein to Imam Sajjad was under particularly distressing circumstances with the severe illness that Imam Sajjad was suffering and the martyrdom of so many family members and companions.
In the book Kitab al-Irshad, it is quoted that:
The Shia give an account of the tablet which Gabriel, peace be on him, brought down to the Prophet, may God bless him and his family, from Heaven. The Prophet gave it to Fatima, peace be on her. In it are the names of the Imams after the Prophet.
The Shia also reports that God, the Mighty and High, sent down to His Prophet, the blessings and peace be on him, a document sealed with twelve seals. He ordered him to give it to Imam Ali, peace be on him, and to tell him to break the first seal, and he should act according to what is in that part of the document.
At the time of his death, he should pass it to his son, Imam Hassan, peace be on him, and tell him to break the second seal and act according to what is in that part of the document. At the time of his death, he should pass it to his brother Hussein, peace be on him. He should tell him to break the third seal and act according to what is below it. Then at his death, he should pass it to his son, Ali bin Hussein and he should instruct him in a similar way. (Mufid 1981, pg. 395)
It could therefore be concluded that this document was given to Imam Sajjad just prior to his father's martyrdom although there are disputed opinions surrounding this matter.
An account concerning the testamentary of bequests (wasiyya) made by Imam Sajjad's father, Imam Hussein, was that they were deposited with Umm Salama for him. He received them when his father died. Imam Hussein made the request for these from Umm Salama, the sign of the Imamate of the one who should request them among men. (cf. al-Kafi, I, 204, tradition number 3), but other sources say that these things were in the hands of Fatima, his daughter, (cf. al-Kafi, I, 363-4} in Al-Mufid 1981, pg.381).
The facts do tend to favor the opinion that the bequests were left in the trusted care of Imam Hussein's daughter, Fatima, as she was present at Karbala, whereas Umm Salama was in Medina at the time, and according to the information above, Imam Sajjad received these bequests at his father's death.
It has been narrated in "Hussein the Savior of Islam" by Ahmed Ali (1964), that Imam Sajjad, the eldest son of Imam Hussein, was lying unconscious on his sick bed at the time when Imam Hussein was preparing to part with the remaining members of his family and the families of his martyred companions.
Imam Hussein went to Imam Sajjad and handed over the charge of the sacred office of Imamate to him. Imam Hussein enumerated the difficulties and the tortures that would befall him immediately following his martyrdom and advised him to observe the highest degree of patience and fortitude against every aggression and oppression that would be inflicted on him and his dear ones, and never to get angry or curse the people (Mir Ahmed Ali, pg 183).
His role was to succeed as the Forth Holy Imam and endure the tribulations and challenges confronting him and the true followers of Allah's religion (Al-Mufid 1981, pg. 380).
Source: Abna24