Answer
If the deceased advises or instructs one in his dream to perform a virtuous
act, while it is not necessary to do so, it is not prohibited either. If one
carries out the advise, he will be rewarded.
and Allah Ta’ala Knows Best
Mufti Ebrahim Desai