perhaps you are interested ...
Author: email@example.com (ulrich-merkel)
once, we had a field called "STUFE" as part of the PK and anything was fine.
Then one decided that STUFE needs to be modifyable and used a TK instead.
Unfortunately, they still want to assure there will be no duplicate value of STUFE.
And they have components where they can add multiple new occs.
Our LFLD trigger (asssumes there will never be an empty value allowed) reads now:
v_savepos = $curocc("<$entname>")
setocc "<$entname>",1 ; to get a complete list, we have to start at occ 1
putlistitems v_valuelist, "<$fieldname>"
setocc "<$entname>",v_savepos ; reeposition to saved pos
delitem v_valuelist,v_savepos ; delete "own" value from the list
if ($item(<$fieldname>,v_valuelist) != "") ; and compare
message/error "duplicate Stufe encountered"
Perhaps one has other ideas how to implement that task?
(Just to keep you fit in creative usage of uniface possibilities)