[Solved] Automatic numbering / Attribute forms, default value expressions: Checked ‘Apply-default-value-on-update’-box results in doubled IDs if movin

jaysigg Asks: Automatic numbering / Attribute forms, default value expressions: Checked ‘Apply-default-value-on-update’-box results in doubled IDs if moving points
I want to create several point-shapefile-layers for raster sampling with QGis 3.16. Each layer consists of 5 to 10 sampling spots (see canvas excerpt). Each spot includes 40 points. Basic spot form is a rectangle with 5 rows, each 8 points. There also several other, rotated/distorted spot forms as for example spot 3 in the canvas excerpt (other forms are not shown), but always following the principle: 5 rows x 8 points.

enter image description here

The Attrribute table contains fields according to the spot/row/point nr. These numbers are derived by the point ID. The IDs start with 1 at the uppermost, left point and then increase towards right, then with rows and spots (see cannvas and attribute table excerpt).
enter image description here

The points of the first spot were created manually. The following spots were created by copying the rectangle spot with the copy-and-move-tool, and in case of the non-rectangle forms also by using the move-tool to shift single points (or the rotation-tool as well in case of other, not shown spot forms).
The field numbering works automatically by attribute form default-expressions. The expression for the ID-numbering is: if (maximum("ID") is NULL, 1 ,maximum("ID") + 1). The numbering of the other fields is derived by ID-dependent default-expressions. ‘Apply default value on update’ is basically checked (see attribute form excerpt).
enter image description here

Principally the numbering works.
But my issue is, that I always have to uncheck ‘Apply default value on update’ as soon as I switch from moving-and-copying or simply setting new points to just moving or rotating them. Otherwise the latter one leads to deletion of the current ID the moved point with giving it a new ID. And vice versa: unchecking the box and then copying-and-moving points will result in doubled IDs. Thus, I have infernally pay attention always to uncheck/check this box. It was no big deal, if I would have only a handful of spots, but there are some more …

So, my question is: Is there any customizing option, to keep the ‘Apply default value on update’-box checked, while not deleting/renewing the IDs if only moving/rotating some points (instead of duplicating)?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.