Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 18 DEC 2000 11:45:58AM a becker wrote:

Is there any way to set an individual record as read-only?

We have a situation where we could have many revisions to a given record. Only the latest revision is the current or active record. (The previous records are available for historical purposes only.)

When we write the new revision, we would like to make the old record read only.

We know that we can set the properties of the fields and controls on the old record to read only, but can we do it for an entire record with one command such as set_property (this record, read_only)

Thanks


At 18 DEC 2000 12:15PM Don Miller - C3 Inc. wrote:

You can make a record read-only by locking it in the READ event:

* get the key

* assume only CURRENT_KEY can be changed

KEY=GET_PROPERTY(CtrlEntId,"DEFPROP")

IF KEY ne "CURRENT_KEY" then

 OPEN "MYTABLE" to TEMP then
     LOCK TEMP,KEY else
  • handle the fact that it is in use somewhere else ..
     END
 END ELSE .. handle open logic error

END

CALL FORWARD_EVENT()

RETURN 0

You will also have to put some additional logic in the Save and Clear events to unlock the key and to clear the SAVEWARN property if it is only a lookup. There's probably a more elegant way to do this. Maybe you can loop through the controls and set the attributes there to disallow changes to the data fields. Sometimes this is a pain because you have to go through and clear them for a new record.

Don Miller

C3 Inc.


At 18 DEC 2000 01:34PM a becker wrote:

  • third_party_content/community/commentary/forums_nonworks/56f58129780937a1852569b9005c196a.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1