Previously, on QGIS 2.18, I followed this well known tutorial to create a user form with some basic Python driven buttons. https://nathanw.net/2011/09/05/qgis-tips-custom-feature-forms-with-python-logic/
The QGIS 3 layer properties interface no longer has the setting (at least not in the same place, so I can't find it) which tells QGIS to run a Python script on opening the form. This is discussed in the tutorial in the section headed "almost done".
How is this achieved?