zoukankan      html  css  js  c++  java
  • D365: 通过集成应用程序的财务维度配置导入财务维度

    
    
    在D365FO中,集成应用程序的财务维度配置可以设置财务维度的格式,用来方便做数据导入,借助此功能,如果有需求导入带财务维度相关的数据时,
    我们可以在集成应用程序的财务维度配置界面,定义我们需要的格式,然后通过以下代码进行调用,就可以生成需要的财务维度的RecId。

    [ExtensionOf(tableStr(DimensionHierarchy))] final
    class DimensionHierarchyTVya_Extension { public static DefaultDimensionIntegrationStructureDisplay getDisplayStringDimensionIntegrationAccountStructure(Name _accountStructure, DimensionHierarchyType _dimensionHierarchyType) { DimensionHierarchyIntegration dimensionHierarchyIntegration; DimensionHierarchy dimensionHierarchy; DefaultDimensionIntegrationStructureDisplay displayString; container cachedResult; ; if (cachedResult == conNull()) { select firstonly DisplayString from dimensionHierarchyIntegration join dimensionHierarchy where dimensionHierarchyIntegration.DimensionHierarchy == dimensionHierarchy.RecId && dimensionHierarchy.StructureType == _dimensionHierarchyType && dimensionHierarchy.Name; if (dimensionHierarchyIntegration.RecId) { cachedResult = [dimensionHierarchyIntegration.DisplayString]; DimensionCache::insertValue(DimensionCacheScope::DimensionDataEntityIntegrationFormat, [_dimensionHierarchyType], cachedResult); } } displayString = conpeek(cachedResult, 1); return displayString; } }
    static void main(Args _args)
        {
            //Ledger dimension format
            LedgerAccountDimensionResolver ledgerAccountDimensionResolver = LedgerAccountDimensionResolver::newResolver("18500|Department|Cost|Item||");
            ledgerAccountDimensionResolver.parmDimensionFormat(DimensionHierarchy::getDisplayStringDimensionIntegrationAccountStructure("LedgerDimensionFormat", 
                                                                                                                DimensionHierarchyType::DataEntityLedgerDimensionFormat));
            DimensionDynamicAccount dynamicsDimension = ledgerAccountDimensionResolver.resolve();
    
            //Default dimension
            DimensionDefaultResolver    dimensionDefaultResolver = DimensionDefaultResolver::newResolver("Department|Cost|Item||");
            dimensionDefaultResolver.parmDimensionFormat(DimensionHierarchy::getDisplayStringDimensionIntegrationAccountStructure("DefaultDimensionFormat", 
                                                                                                                DimensionHierarchyType::DataEntityDefaultDimensionFormat));
            DimensionDefault    dimensionDefault = dimensionDefaultResolver.resolve();
        }
  • 相关阅读:
    面向对象(二)之三大特性
    面向对象(一)之类和对象
    java基础知识(三)之数组
    Java基础知识(二)之控制语句
    java基础知识(一)之数据类型和运算符
    事件模型
    AWT和布局管理器
    选择器
    颜色值与长度
    排版与缩写
  • 原文地址:https://www.cnblogs.com/dingkui/p/15700451.html
Copyright © 2011-2022 走看看