zoukankan      html  css  js  c++  java
  • How to get Financial Dimension Value from Worker Position[AX2012]

    To get financial dimension value from worker position, add a new method in hcmWorker Table with script like below:

    public static str getDimensionValue
              (HcmWorkerRecId _workerRecId, 
               Name _DimensionName, 
               utcdatetime _asOfDate = DateTimeUtil::utcNow())
    {
        DimensionAttributeValueSetStorage             dimStorage;
        str                                                             dimValue;
        Counter                                                     Counter;
        HcmPositionDefaultDimension                    _HcmPositionDefaultDimension;
        RecId                                                       _DefaultDimension;
        ;
        select _HcmPositionDefaultDimension where
        _HcmPositionDefaultDimension.Position == HcmWorker::getPrimaryPosition(_workerRecId);
        dimStorage = DimensionAttributeValueSetStorage::find
                             (_HcmPositionDefaultDimension.DefaultDimension);
        for (Counter=1 ; Counter<= dimStorage.elements() ; Counter++)
        {
             if(DimensionAttribute::find(dimStorage.getAttributeByIndex(Counter)).Name == _DimensionName)
             {
                   dimValue = dimStorage.getDisplayValueByIndex(Counter);
             }
        }
        return dimValue;
    }

    After it, if we wanna make display method to show financial dimension, we can use method above. In example we wanna display dimension site from a worker who have PersonnelNumber = "00001". The script is like below :

    display str Site()
    {
              return hcmWorker::getDimensionValue(
                        hcmWorker::findByPersonnelNumber("00001").recid, "Site");
    }
  • 相关阅读:
    gdb --configuration
    firecracker 编译
    gvisor 编译
    gvisor
    rust Deref
    rust explicit
    rust move
    rust drop
    出租人对经营租赁的会计处理
    关于以公允价值计量的投资性房地产的处置
  • 原文地址:https://www.cnblogs.com/Fandyx/p/3355709.html
Copyright © 2011-2022 走看看