Метод getHierarchyIdByHierarchyType с таблички DimensionHierarchy
X++:
switch (_hierarchyType)
{
case DimensionHierarchyType::BankAccount:
dimHierarchyHashKey = str2guid('{FF110312-6D94-45BB-ABFF-009BBACCBD10}');
break;
case DimensionHierarchyType::Customer:
dimHierarchyHashKey = str2guid('{FF070411-8BCB-49DB-9A4F-45B2231C725A}');
break;
case DimensionHierarchyType::DefaultAccount:
dimHierarchyHashKey = str2guid('{FF1607AD-7E2D-41C7-9D88-3693A50A2038}');
break;
case DimensionHierarchyType::Employee:
dimHierarchyHashKey = str2guid('{FF1207E9-A7CE-4630-81A0-0F1DFC7C8AE2}');
break;
case DimensionHierarchyType::FixedAsset:
dimHierarchyHashKey = str2guid('{FF100857-10E4-4E15-B0DB-2E67E1E8CAC7}');
break;
case DimensionHierarchyType::Item:
dimHierarchyHashKey = str2guid('{FF1300C0-8E38-4E03-B5D6-9B75EEB2A287}');
break;
case DimensionHierarchyType::Project:
dimHierarchyHashKey = str2guid('{FF090EC7-9F35-40F2-A577-4118722A7D57}');
break;
case DimensionHierarchyType::Vendor:
dimHierarchyHashKey = str2guid('{FF080005-E805-4013-80AD-67E26925831A}');
break;
case DimensionHierarchyType::AllAttributeStructure:
dimHierarchyHashKey = str2guid('{686c7df0-5e1b-4b6c-a38d-5853140c511b}');
break;
// <GEERU>
case DimensionHierarchyType::FixedAssets_RU:
dimHierarchyHashKey = str2guid('{92D0E12F-1B46-4577-857E-71BAC425C3A7}');
break;
case DimensionHierarchyType::RDeferrals:
dimHierarchyHashKey = str2guid('{B09F18CF-C660-432D-AB59-F86BC3972D07}');
break;
case DimensionHierarchyType::RCash:
dimHierarchyHashKey = str2guid('{FE5AA513-2CE8-4928-B542-98055B2EFB51}');
break;
case DimensionHierarchyType::Employee_RU:
dimHierarchyHashKey = str2guid('{248A8DD0-23F3-49E4-88E0-3446F305C00A}');
break;
// </GEERU>
default:
throw error(Error::wrongUseOfFunction(funcName()));
}
ttsbegin;
// The hierarchy is system generated
dimHierarchy.IsSystemGenerated = true;
dimHierarchy.StructureType = _hierarchyType;
dimHierarchy.IsDraft = false;
dimHierarchy.Name = dimHierarchyName;
dimHierarchy.HashKey = dimHierarchyHashKey;
dimHierarchy.insert();
Просто нравится такой код. Чувствуется мысль..Интересно что завязано на данные константы?