Please enable JavaScript to view this site.

Codolex

Navigation: Activities > Variables

Clone entity

Scroll Prev Top Next More

The clone entity activity creates a new instance of an existing entity.

 

CloneEntity

Activity properties

 

begin

var SecondEvent: CodolexProject.DataSource.TestDB.IEvent;

 SecondEvent := CodolexProject.DataSource.TestDB.TEvent.Create;

 SecondEvent.EventId := Event.EventId;

 SecondEvent.CourseId := Event.CourseId;

 SecondEvent.LocationId := Event.LocationId;

 SecondEvent.EventDate := Event.EventDate;

 SecondEvent.poster := Event.poster;

 SecondEvent.Location := Event.Location;

 SecondEvent.Course := Event.Course;

 SecondEvent.EventRegistrations := Event.EventRegistrations;

end;

Resulting Code

 

Keep in mind that some properties that must be unique to entities in the database needs to be replaced with a different value.

Associations are included as well, although the associated objects are not cloned.

 

© by GDK Software