Class Member Class: Index
Check() This method checks for the existence of the key and locks the object associated with that key. The optional lockonly parameter is used to validate the key. If lockonly is true then we just want to acquire/release a lock for the id associated with the key value. If the key value doesn't exist then lockonly causes a success status to be returned, otherwise failure is returned. If lockonly is not true then the id associated with the key is looked up, if found the associated object is locked/released. Also, the key is validated again after the lock is acquired. A %Status value is returned.
Exists() This method returns true if an object whose index key value matches the value/values passed in by the caller. The optional byref id parameter will contain the id matching the object that was found to match the index key value upon a successful return.
The index Open method is generated as a member method for for unique and primary key indices as well as an IDKEY index based on more than one index property. This method, Open, will open the object whose index property values match the supplied values. If no object that matches the supplied values is found then if the optional status parameter is set to an error message. This interface is the same as %OpenId except that
Open accepts one parameter corresponding to each property in the index. For example:
Set person = ##class(Sample.Person).SSNKeyOpen("111-22-3333",2,.sc)
Upon successful execution, person will be the oref that references an instance of Sample.Person whose SSN property value is "111-22-3333". The concurrency value is 2 and, if an error occurred its value will be in the variable sc.