uniface.Occurrence

The uniface.Occurrence object provides access to selected properties of the occurrence that it represents. It is returned by the getOccurrence function of the uniface.Entity object.

Functions

Data Addressing Functions

Function

Description

getLabel() Returns a Label object representing the label of the field.
getName() Returns the fully-qualified name of the Entity (EntityName.ModelName).
getShortName() Returns the unqualified name of the current Entity (EntityName).
getType() Returns a constant string denoting the object type: uniface.TYPE_OCCURRENCE.
getParent() Returns an uniface.Entity object that represents the parent of the current Occurrence.
getInstance() Returns the uniface.Instance object that represents the DSP instance of which this Occurrence is a part.
getIndex() Returns the sequence number that the Occurrence has in the ordered set of its parent Entity's occurrences.
getStatus() Returns the status of the Occurrence.
getField() Returns the uniface.Field object that represents the specified field in this Occurrence
getEntity() Returns a uniface.Entity object that represents the specified child entity of this Occurrence
getFields() Returns an array of uniface.Field objects that represent the fields in the uniface.Occurrence object.
getEntities() Returns an array of uniface.Entity objects that represent the entities that are direct children of the Occurrence
isEqualTo() Checks whether the uniface.Occurrence object is the same as another uniface.Occurrence object.
Occurrence API Functions

Function

Description

discard Deletes the Occurrence on the client only.
insertNewAfter() Inserts a new Occurrence after this one.
insertNewBefore() Inserts a new Occurrence before this one.
remove() Deletes the Occurrence on the client. (A databases occurrences is marked for deletion on the server).
getProperty() Returns the value of a property of the current occurrence
setProperty() Sets the specified occurrence property to a given value.
clearProperty() Restores the initial value of the specified property.
getProperties() Returns the properties of the current occurrence.
setProperties() Sets properties for an occurrence.
clearProperties() Restores the initial properties of the occurrence.
var vInstance = uniface.getInstance("MUSICLIST");
if (vInstance != null) {
    var vEntity = vInstance.getEntity("ITEMS.MUSICSHOP");
    if (vEntity != null) {
        var vOccs = vEntity.getOccurrences();
        for (var i =  0; i < vOccs.length; i++) {
            doSomethingWithOccurrence(vOccs[i]);
        }
        var vOcc = vEntity.getOccurrence(4);
        if (vOcc) {
            alert (vOcc + " has status " + vOcc.getStatus());
        }
    }
}

Related Topics