public EntityCollection Entities {get;}
public EntityCollection Entities {get;}
Exception | Description |
---|---|
System.Exception | Exception is thrown if the Entity.DbName cannot be found. |
WrNoMetadataColumnsDefinedException | Exception is thrown if trying to create custom formula columns but no column metadata exists for the Entity (Data Object) yet. |
System.Exception | Exception is thrown when attempting to add an entity object with the same name (aka alias) already exists in the collection. Entity names must be unique. |
Entity myNewEntity = api.Entities.NewEntity("Campaigns"); myNewEntity.DataSourceId = api.DataSources.GetDataSource("Donations MSSQL").Id; myNewEntity.ObjectType = DataObjectType.Table; myNewEntity.Id = "campaigns"; //This is the Admin Console's Id field myNewEntity.DbName = "Campaigns"; //This is the Admin Console's Name field myNewEntity.Name = "campaigns"; //This is the Admin Console's Alias field myNewEntity.ObjectDescription = "Fundraising campaigns"; myNewEntity.Category = "CRM\\Sales"; //This is the Admin Console's Folder field api.SaveConfigToFile(); //Persist change to the XML config file.
Entity employees = api.Entities.NewEntity("Employees"); employees.DataSourceId = api.DataSources.GetDataSource("Northwind").Id; employees.ObjectType = DataObjectType.SqlStmt; employees.Id = "employees_1"; employees.Name = "Employees";