How to get Financial Dimension Value from Worker Position[AX2012]
2024-09-15 01:58:35
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= ; 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("").recid, "Site");
}
最新文章
- CSS 预处理器(框架)初探:Sass、LESS 和 Stylus
- php 经典的算法题你懂的
- 【读书笔记】iOS-GCD-API
- Spring MVC Spring MyBatis 整合 - 快速上手
- C#开源系统大汇总(转)
- js获得鼠标的位置
- Jquery 计算表格某一列的合计
- Android KeyLogger Demo
- fatal: The remote end hung up unexpectedly
- Linux6.X图形界面如何打开终端以及如何将终端加入右键
- java线程安全问题以及使用synchronized解决线程安全问题的几种方式
- R语言do.call 函数用法详解
- mybatis和hibernate的区别
- webclient 操作超时
- 关于STM32时钟系统
- java.lang.OutOfMemoryError: GC overhead limit exceeded
- 运放参数的详细解释和分析-part3,输入失调电压Vos及温漂
- 【BZOJ】3683: Falsita
- 【Java并发编程】之十三:生产者—消费者模型
- jQuery监控文本框事件并作相应处理的方法