Sunday, 15 May 2016

Get Department Financial Dimension Value


  • To get Department financial dimension value from Journal Transactions (LedgerJournalTrans)
// BP Deviation Documented
public display OMOperatingUnitNumber sha_displayDepartment()
{

    DimensionAttribute                  dimAttribute = DimensionAttribute::findByName('Department'); // Change 'Department' to which dimension you are looking for
    DimensionAttributeValueSetItemView  dimAttributeValueSetItemView;

    select firstOnly dimAttributeValueSetItemView
        where dimAttributeValueSetItemView.DimensionAttributeValueSet == this.DefaultDimension &&
              dimAttributeValueSetItemView.DimensionAttribute == dimAttribute.RecId;
   
    return dimAttributeValueSetItemView.DisplayValue;
}



  • To get Department financial dimension value from Voucher Transactions (GeneralJournalAccountEntry)

 
// BP Deviation Documented
public display OMOperatingUnitNumber sha_displayDepartment()
{
    DimensionAttribute                  dimAttribute = DimensionAttribute::findByName('Department'); // Change 'Department' to which dimension you are looking for
    DimensionAttributeLevelValueAllView dimAttributeLevelValueAllView;
   
   
    select firstOnly dimAttributeLevelValueAllView
        where dimAttributeLevelValueAllView.ValueCombinationRecId == this.LedgerDimension &&
              dimAttributeLevelValueAllView.DimensionAttribute == dimAttribute.RecId;
   
    return dimAttributeLevelValueAllView.DisplayValue;
}

1 comment:

  1. Hi Shankar,

    Requesting you to kindly help me in my predicament.

    I'm working in a company that is currently deploying AX 2012 with EP, and a Microsoft Gold-Certified Partner re-seller has been contracted for this job.

    Applications on the EP are submitted to the workflow for approval. Currently, as soon as the approving user approves the application, it vanishes from the user's account & screen. You can imagine how difficult it becomes to keep track of all applications approved.

    My question is: Is it possible to retain these applications at the approving user's end after approval? And if possible, would it be a such sizable a task to warrant denial of the request?

    The re-seller team is telling me this is impossible. Note there are two levels of approval in the workflow, and the application would have to be retained at both levels. I'll be revisit your blog periodically in hopes of you agreeing to help and provide a response.

    ReplyDelete