zoukankan      html  css  js  c++  java
  • AX2012 查询财务维度

    ----------------------------------------------------------method 1

    static void jay_testDimension(Args _args)
    {
    int i;
    str theName;
    str theValue;
    DimensionAttribute dimensionAttribute;
    DimensionAttributeValueSetStorage dimStorage;
    DimensionDefault defaultDimension = 5637152844;
    DimAttributeProjTable aaa;
    ;

    dimStorage = DimensionAttributeValueSetStorage::find(defaultDimension);

    for (i=1 ; i<= dimStorage.elements() ; i++)
    {
    dimensionAttribute = DimensionAttribute::find(dimStorage.getAttributeByIndex(i));
    if(dimensionAttribute.BackingEntityTableId == tableNum(ProjTable))
    {
    theValue = dimStorage.getDisplayValueByIndex(i);
    info("项目 " + theValue);
    }
    if(dimensionAttribute.BackingEntityTableId == tableNum(VendTable))
    {
    theValue = dimStorage.getDisplayValueByIndex(i);
    info("供应商 " + theValue);
    }
    if(dimensionAttribute.BackingEntityTableId == tableNum(OMOperatingUnit))
    {
    theValue = dimStorage.getDisplayValueByIndex(i);
    info("部门 " + theValue);
    }
    }

    }

    -------------------------------------------------method 2

    void FindFinDimension()
    {
    SalesTable salesTable;
    DimensionAttributeValueSetItem DimensionAttributeValueSetItem;
    DimensionAttributeValueSet DimensionAttributeValueSet;
    DimensionAttributeValue DimensionAttributeValue;
    DimensionAttribute DimensionAttribute;
    container c;
    ProjTable ProjTable;
    OMOperatingUnit OMOperatingUnit;

    while select salesTable
    where salesTable.SalesId == this.RefSalesId//"SO000067"
    //join DimensionAttributeValueSet
    // where DimensionAttributeValueSet.RecId == salesTable.DefaultDimension
    join DimensionAttributeValueSetItem
    where DimensionAttributeValueSetItem.DimensionAttributeValueSet == salesTable.DefaultDimension
    join DimensionAttributeValue
    where DimensionAttributeValue.RecId == DimensionAttributeValueSetItem.DimensionAttributeValue
    join DimensionAttribute
    where DimensionAttribute.RecId == DimensionAttributeValue.DimensionAttribute
    {
    //info(strFmt("%1,%2",DimensionAttribute.Name,DimensionAttributeValueSetItem.DisplayValue));
    if(DimensionAttribute.BackingEntityType == tableNum(DimAttributeOMDepartment))
    {
    select firstOnly OMOperatingUnit
    where OMOperatingUnit.OMOperatingUnitNumber == DimensionAttributeValueSetItem.DisplayValue;
    this.DimensionsDepartment = OMOperatingUnit.RecId;

    }
    if(DimensionAttribute.BackingEntityType == tableNum(DimAttributeProjTable))
    {
    select firstOnly ProjTable
    where ProjTable.ProjId == DimensionAttributeValueSetItem.DisplayValue;
    this.DimensionsProj = ProjTable.RecId;
    }
    }
    }

  • 相关阅读:
    今天去一个物流公司參观的一些体会
    Yii学习笔记之四(表单验证 api 翻译)
    IT忍者神龟之Hibernat持久化对象-数据表映射配置回想
    LeetCode:Unique Binary Search Trees
    nodejs版本号更新问题:express不是内部或外部命令
    让Apache 和nginx支持跨域訪问
    聊聊高并发(十六)实现一个简单的可重入锁
    【iOS】自己定义TabBarController
    《互联网医疗大棋局》中美移动医疗领域的现状、机会、限制。五星推荐
    《无穷的开始:世界进步的本源》量子物理学家的哲学思考。三星推荐
  • 原文地址:https://www.cnblogs.com/xiangliqi/p/4759309.html
Copyright © 2011-2022 走看看