clsImportUserDefinedField Class |
Please use first the GetListUserDefinedFields of each dimension to check if the User Definied Field is already created.
Namespace: MARIInterface
The clsImportUserDefinedField type exposes the following members.
| Name | Description | |
|---|---|---|
| clsImportUserDefinedField | Initializes a new instance of the clsImportUserDefinedField class |
| Name | Description | |
|---|---|---|
| ClassID |
Class ID for finding the correct table, where the field should be created. [Mandatory Field] | |
| ComboboxConnectionType |
Combobox Connection Type.
| |
| ComboboxDataSource |
Combobox Data Source.
| |
| ComboboxDataType |
Combobox Data Type.
| |
| ComboboxUDF |
Flag to set the user defined field as combobox field.
| |
| Description |
MARIProject display name/ description [Mandatory Field] | |
| FieldName |
Database field name. [Mandatory Field]. The field name must begin with "USER_" | |
| FieldSize |
Database field size.
| |
| FullTextIndexable |
Flag for setting the full text search support.
| |
| SearchClass |
Seach class ID (Link class ID)
| |
| Type |
Field Type (INT, NVARCHAR...) of the field.
| |
| UserDefinedFieldID |
Import User Defined Field ID
|
The Mandatory Fields are:
public bool CreateUDF() { // Check if user defined field already exists MARIInterface.clsImportPhase oPhase = new MARIInterface.clsImportPhase(); System.Collections.Generic.List<MARIInterface.clsImportUserDefinedFieldDefinition> oList = oPhase.GetListUserDefinedFields(oMPInterface); bool bFound = false; foreach (MARIInterface.clsImportUserDefinedFieldDefinition oField in oList) { if (oField.FieldName == "USER_UDF1") { bFound = true; } } if (!bFound) { // Create user defined field MARIInterface.clsImportUserDefinedField NewUDF = new MARIInterface.clsImportUserDefinedField(); // Only possible for dimensions with user defined fields NewUDF.ClassID = MARIInterface.clsImportBase.eCoreDataClassID.Phase; NewUDF.FieldName = "USER_UDF1"; NewUDF.Type = MARIInterface.clsImportUserDefinedField.eFieldType.Integer32Bit; NewUDF.Description = "User Defined Field 1"; if (!oMPInterface.bImportUserDefinedField(NewUDF, MARIInterface.clsImportBase.eImportMode.ValidateAndImport)) { // oTimeKeepingLine.oErrors contains all Errors throw new Exception(oMPInterface.oErrors.PrintErrors()); } else { return true; } } return false; }