The principle of freedom of testation is strongly entrenched in our law. This means that a person can as a general rule attach any conditions to a bequest and an inheritance in his will. One exception is where a condition is contrary to Public Policy or the Constitution. You can, for example, not bequeath an asset to a beneficiary subject thereto that he commits a crime. Such a condition would be unlawful and invalid.
You can, however, leave your farm, for example, to your son subject thereto that his son, in other words, your grandson, inherits the farm after your son’s death. This is called a fideicommissum and would be lawful. Whether it is a good idea, is, of course, another question.
My advice to clients often is not to rule from the grave as it can create serious headaches for beneficiaries. Rather leave it to the beneficiaries to decide what they want to do with their inheritance based on their circumstances at the time.