Adding a Runtime Dynamic Property

You can add a runtime dynamic property by using the following methods of the JadeDynamicPropertyCluster class.

Method Description
addDynamicProperty

Adds a new runtime dynamic property to the receiving cluster using the specified information.

The addDynamicProperty method of the Class class provides equivalent functionality.

addExclusiveDynamicProperty Adds a new exclusive runtime dynamic property to the receiving cluster using the specified information.

In the following example, a runtime dynamic property called email is added to the Customer class into a cluster called CustomerCluster that must have been created previously.

vars
    cluster : JadeDynamicPropertyCluster;
begin
    cluster := Customer.findDynamicPropertyCluster("CustomerCluster");
    beginTransaction;
    cluster.addDynamicProperty("email", String, 30, 0.Byte);
    commitTransaction;
end;

The previous example could be coded with the following equivalent.

begin
    beginTransaction;
    Customer.addDynamicProperty("CustomerCluster", "email", String, 30, 0.Byte);
    commitTransaction;
end;

In the following example, an exclusive runtime dynamic property called allAppointments is added to the Customer class.

vars
    cluster : JadeDynamicPropertyCluster;
begin
    cluster := Customer.findDynamicPropertyCluster("CustomerCluster");
    beginTransaction;
    cluster.addExclusiveDynamicProperty("allAppointments", AppointmentDict);
    commitTransaction;
end;

You cannot add a runtime dynamic property through the Class Browser.