This is a common fault with the 300Tdi and as Gords said the problem is normally with the connection at the rear of the alternator.
It's either a white wire or black/white wire onto a spade connector, these connectors are not very good and you can either replace it with a new one (which for me has cured the problem for the last 5 years) or clear up the connection and try to make it tight again by crimping the spade connector a little.