AX 2012 Get Financial Dimension Value by Worker RecID

public Name mscGetOriginatorFinancialDimension(RefRecId _workerRecId)
{
    RecId       defaultDimension;
    DimensionAttributeValueSet      dimAttrValueSet;
    DimensionAttributeValue         dimAttrValue;
    DimensionAttribute              dimAttr;
    Common                          dimensionValueEntity;

    defaultDimension        = HcmEmployment::findByWorkerLegalEntity(_workerRecId, CompanyInfo::current()).DefaultDimension;
    dimAttrValueSet         = DimensionAttributeValueSet::find(defaultDimension);
    dimAttrValue            = DimensionAttributeValue::find(DimensionAttributeValueSetItem::find(dimAttrValueSet.RecId).DimensionAttributeValue);
    dimAttr                 = DimensionAttribute::find(dimAttrValue.DimensionAttribute);

    dimensionValueEntity    = DimensionDefaultingControllerBase::findBackingEntityInstance(
            curext(),
            dimAttr,
            dimAttrValue.EntityInstance);

    //info(dimAttr.Name + ' ' + dimAttrValue.getValue() + ' ' + dimAttrValue.getName());

    return dimAttrValue.getName();
}

Comments

  1. Best Crypto Casino Bonuses
    ‎Best Crypto Casino Bonuses · ‎Best Bitcoin Casino · ‎Online Slots · ‎Slots deccasino Games · 1xbet ‎Live Dealer Casino · ‎Online Live Casino 인카지노

    ReplyDelete

Post a Comment

Popular posts from this blog

AX 2012 R3: Cannot edit a record in Purchase order - update table (PurchParmTable).

AX 2012: The AOS server name or instance name is not correctly configured