Using the Checksum check
In the model: model a public calculated attribute for the checksum for each relevant component and implement it in the this way:
Datatype: a string with length 40.
In the OnGet hook: invoke the CalculateChecksum method for the component and assign it to the checksum attribute, for example:
o.checksum = Items.CalculateChecksum()
In the BeforeExecute hook: check the old value of the checksum (provided via the change request) and return an error if the values do not match. For example:
if i.checksum.isSet and (strip$(i.checksum) <> Items.CalculateChecksum()) then
dal.set.error.message("@Instance changed by other user!")
io.cancel = true
endif
return(0)
Note: If the provided checksum calculations are not sufficient (for
example, a calculation based on a DLL call may be involved or some particular
fields may be sufficient), you can write your own checksum functions based on
the functions that are generated by
LN Studio
and call calculate.checksum() to calculate the actual checksum as 40 character
single-byte string.