AddAttribute(AttrIndex: Integer);
AttrIndex. Reserved index of a standard attribute.
The AddAttribute method adds a standard attribute to the list of attributes available when calendar dictionary is created.
A number of standard attributes can be used for calendar dictionaries:
| Reserved attribute index | Attribute identifier. | Attribute name |
| 0 | NAME | Calendar element name. |
| 1 | START_DATE | Start date of the period. |
| 2 | FINISH_DATE | End date of the period. |
| 3 | BLOCK_TYPE | Dictionary block type. |
| 4 | LEVEL_TYPE | Type of dictionary level. |
| 5 | BLOCK_NAME | Name of dictionary block. |
| 6 | LEVEL_NAME | Name of dictionary level. |
| 7 | ORDER | Order. |
| 8 | ID | Identifier. |
| 9 | PERIOD | Period. |
| 10 | YEAR | Year number. |
| 11 | HALF_OF_YEAR | Half-year number. |
| 12 | QUARTER | Quarter number. |
| 13 | MONTH | Month number. |
| 14 | WEEK_OF_YEAR | Number of a week in a year. |
| 15 | DAY_OF_WEEK | Number of a day in a week. |
| 16 | DAY_OF_MONTH | Number of a day in a month. |
| 17 | DAY_OF_YEAR | Number of a day in a year. |
Every attribute has reserved index, that is used for extension of attribute list, values for which are calculated while building a dictionary. By default the list contains a certain set of attributes. The list depends on the selected calendar hierarchy.
Executing the example assumes that the repository contains a calendar dictionary with the CALENDAR_DIM identifier.
Sub UserProc;
Var
MB: IMetabase;
MObj: IMetabaseObject;
CalDim: ICalendarDimension;
Begin
MB:=MetabaseClass.Active;
MObj:=MB.ItemById("CALENDAR_DIM").Edit;
CalDim:=MObj As ICalendarDimension;
CalDim.AddAttribute(2);
MObj.Save;
End Sub UserProc;
After executing the example the Finish_ Date attribute is added to calendar dictionary.
See also: