Is it possible to set automatic field updates before printing or saving a document?

I often create documents with many internal links (between different chapters of the document) and an automatic table of contents (based on headers).

The table of contents is never automatically updated (I’m not sure about the other fields). I have to update it manually each time I want to print document or export it to PDF. It would be convenient to enable automatic updating of all fields.