We will now add the fields of the new Project class to the edit form. This step is required if you are going to use Cartella's built in Edit Form or if you want to use Cartella's validation.

Run the following script to insert the Edit Form definitions into the database for type Project. These definitions allow the Edit Form to be rendered.

Note

The IsRequired field has been depricated.

CopySQL
declare @editFormTargetType int

INSERT INTO [Table_EditFormDefinition_Main]
           ([TargetType])
     VALUES
           ('Cartella.Classes.Project')
select @editFormTargetType = @@IDENTITY

INSERT INTO [Table_EditFormDefinition_Fields]
           ([ID_EditFormDefinition]
           ,[FieldName]
           ,[ObjectPropertyName]
           ,[FieldType]
           ,[FieldLabel])

     VALUES
           (@editFormTargetType
           ,'Name'
           ,'Name'
           ,'Text'
           ,'Name')

INSERT INTO [Table_EditFormDefinition_Fields]
           ([ID_EditFormDefinition]
           ,[FieldName]
           ,[ObjectPropertyName]
           ,[FieldType]
           ,[FieldLabel])

     VALUES
           (@editFormTargetType
           ,'Description'
           ,'Description'
           ,'HTML'
           ,'Description')

INSERT INTO [Table_EditFormDefinition_Fields]
           ([ID_EditFormDefinition]
           ,[FieldName]
           ,[ObjectPropertyName]
           ,[FieldType]
           ,[FieldLabel])

     VALUES
           (@editFormTargetType
           ,'Asset'
           ,'Asset'
           ,'Document'
           ,'Project Assets')

INSERT INTO [Table_EditFormDefinition_Fields]
           ([ID_EditFormDefinition]
           ,[FieldName]
           ,[ObjectPropertyName]
           ,[FieldType]
           ,[FieldLabel])

     VALUES
           (@editFormTargetType
           ,'Z1StartDate'
           ,'StartDate'
           ,'Date'
           ,'Start Date')

INSERT INTO [Table_EditFormDefinition_Fields]
           ([ID_EditFormDefinition]
           ,[FieldName]
           ,[ObjectPropertyName]
           ,[FieldType]
           ,[FieldLabel])

     VALUES
           (@editFormTargetType
           ,'Z2ProjectedEndDate'
           ,'ProjectedEndDate'
           ,'Date'
           ,'Projected End Date')

INSERT INTO [Table_EditFormDefinition_Fields]
           ([ID_EditFormDefinition]
           ,[FieldName]
           ,[ObjectPropertyName]
           ,[FieldType]
           ,[FieldLabel])

     VALUES
           (@editFormTargetType
           ,'Z3ActualEndDate'
           ,'ActualEndDate'
           ,'Date'
           ,'Actual End Date')

INSERT INTO [Table_EditFormDefinition_Fields]
           ([ID_EditFormDefinition]
           ,[FieldName]
           ,[ObjectPropertyName]
           ,[FieldType]
           ,[FieldLabel])

     VALUES
           (@editFormTargetType
           ,'Z4CurrentStatus'
           ,'CurrentStatus'
           ,'Dropdown'
           ,'Current Status')

INSERT INTO [Table_EditFormDefinition_Fields]
           ([ID_EditFormDefinition]
           ,[FieldName]
           ,[ObjectPropertyName]
           ,[FieldType]
           ,[FieldLabel])

     VALUES
           (@editFormTargetType
           ,'OwnerFolio'
           ,'OwnerFolio'
           ,'Hidden'
           ,'Owner Folio')