Skip to content

BeforeDeleteInstance ​

This event is triggered before an "instance" (see below) is deleted.

Parameters ​

ParameterDescription
instidintValue, the ID of the deleted instance.
classidintValue, the class ID of the deleted instance.
modelid (idValue, optional) -ue, the model ID of the deleted instance.

Exit value: ​

|0|No abortion.| |-1|Abort without error.| |-2|Abort with error.| |greater than 0|Abort with core error code.|

Remarks ​

Instances are: Modeling objects, record rows, attribute profiles.

Mind the difference between deleting and discarding. Discarding means removing from memory, but the discarded instance may still exist as a part of its model (in the database). Deleting means, that the instance is removed from its model. Deleting implies discarding.

See Also ​

Example ​

The following example displays the predefined parameters before deleting an instance in an INFOBOX.

leo-grammar
	ON_EVENT "BeforeDeleteInstance" {
	SET id_InstId: (instid) 
	SET id_ClassId: (classid) 
	SET id_ModelId: (modelid)
	CC "AdoScript" INFOBOX ("Modelid:   " + STR(id_ModelId)  + "  ClassId:  " + STR(id_ClassId) + 
	"  InstanceId:   " + STR(id_InstId) )  title:"You are deleting the instance..."
	}