Modify Method

[This is preliminary documentation and subject to change.]

This is the Modify method of the MsiView object. This method modifies a database row with a modified MsiRecord object obtained by the Fetch method.

Syntax

object.Modify action, record

Parts

object
MsiView object.
action
Required action to be performed on the database row. This action is one of the following:
irmInsert
Inserts the information into the database table. The database must not be read-only. The operation does not require a Fetch method to have been performed before it is called. The function fails if a row with the same primary key exists in the table.
irmInsertTemporary
Temporarily inserts the information into the database table. The information is not persisted. The database can be read-only. The operation does not require a Fetch method to have been performed before it is called. The function fails if a row with the same primary key exists in the table.
irmUpdate
Updates the information already existing in the database allowing modification of non-primary keys only. The database must not be opened read-only. The operation requires a Fetch method to have been performed before it is called and has to be called with the same record as that returned by the fetch. The function fails if the row has been deleted from the table.
irmDelete
Deletes the information already existing in the database. The database must not be opened read-only. The operation requires a Fetch method to have been performed before it is called and has to be called with the same record as that returned by the fetch. The function fails if the row has been deleted from the table.
irmRefresh
Refreshes the information in the record from the database. The database can be opened read-only. The operation requires a Fetch method to have been performed before it is called and has to be called with the same record as that returned by the fetch. The function fails if the row has been deleted from the table.
irmAssign
Inserts/updates the information in the database table. The database must not be opened read-only. The operation does not require a Fetch method to have been performed before it is called. An update operation takes place if primary keys match an existing row. An insert operation takes place if primary keys do not match any row. In either case, the current data in the record is written to a table row.
irmMerge
Inserts/validates the information in the database table. The database must not be opened read-only. The operation does not require a Fetch method to have been performed before it is called. An insert operation takes place if primary keys do not match any row. A validation operation takes place if primary keys match an existing row. The operation fails if the record data does not match the data in the table.
irmReplace
Updates/deletes-inserts the information into the database table. The database must not be opened read-only. The operation requires a Fetch method to have been performed before it is called and has to be called with the same record as that returned by the fetch. If the primary key has not been changed, an update of the table row occurs. If the primary key has been changed, the old table row is deleted and a new row corresponding to the record is inserted.
irmValidate
Validates a record, but will not validate across joins. The database can be opened read-only. The operation requires a Fetch method to have been performed before it is called and has to be called with the same record as that returned by the fetch. Validation errors can be obtained by subsequent calls to the GetError method.
irmValidateNew
Validates a record as a new record. The database must not be opened read-only. Will not validate across joins. This differs from irmValidate in that it checks for duplicate keys. The operation requires that the MsiDatabase.OpenView method be called with a modify value. Validation errors can be obtained by subsequent callings to the GetError method.
irmValidateField
Validates a field of a fetched or new record. The database can be opened read-only. Will not validate across joins. The validation depends upon the number of fields in the record. If only one field exists, it validates that field. It can also validate more fields. It should be used when the fetched/new record does not represent every column of the table. Makes repeated validate calls depending upon the number of fields in the record. Validation errors can be obtained by subsequent calls to the GetError method.
irmValidateDelete
Validates a row of a fetched record that will later be deleted. The database must not be opened read-only. Will not validate across joins. The operation requires a Fetch method. Validation errors can be obtained by subsequent calls to the GetError method. A validation error occurs if another row of a table references the primary key fields of the record to be deleted.
record
Required MsiRecord object obtained by the Fetch method with modified field data.