How to add links to random notes to daily note

Unfortunately, that is not the case for me. I added the code to a template that is loaded when a new daily note is generated. However, this will still change the link every time I reopen the daily note or switch between read and edit view.