web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

How to get HcmWorker Dimension using ResourceView

(0) ShareShare
ReportReport
Posted on by 84

Hello,

Our goal is to fetch the HcmWorker's ProductLine Dimension in the ProjProjectTransactionsListPage. A user has asked that we are able to filter using this column. Previously I had create a display method using the following code to fetch the dimension correctly:

 public display str productLine()
    {
        str productLine = "";
        int i;
        HcmWorker hcmWorker = HcmWorker::findByPersonnelNumber(this.ResourceId);
        DimensionAttributeValueSetStorage dimStorage = DimensionAttributeValueSetStorage::find(hcmWorker.getDefaultDimension(CompanyInfo::current()));

        for (i= 1 ; i<= dimStorage.elements() ; i  )
        {
            if(DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name == "ProductLine")
            {
                productLine = dimStorage.getDisplayValueByIndex(i);
            }
        }
        
        return productLine;
    }

Since we cannot filter using a display method, I am now trying to figure out how to use the form's ResourceView to fetch the dimension. I'm not sure how to proceed since my code fetches the hcmWorker.getDefaultDimension(CompanyInfo::current()). 

Is what I am trying to do even possible?

Thanks in advance.

I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    299,397 Super User 2025 Season 2 on at
    RE: How to get HcmWorker Dimension using ResourceView

    Hi Alex,

    You can create a view using another view 'DimensionAttributeLevelValueView'. There are three important fields here:

    - DimensionAttribute: A reference to the DimensionAttribute table where you can filter for your 'ProductLine' dimension name.

    - AttributeValueRecId: The value used in the DefaultDimension field.

    - DisplayValue: Contains the value of the dimension.

    With this information, I do hope you can create a view containing a value for the worker reference and the displayvalue. If you have that, you can add this view as datasource via a form extension, set the link and add the field on the form.

    Using this approach, you will be able to filter on the column.

  • Suggested answer
    Sheikh Sohail Profile Picture
    6,125 on at
    RE: How to get HcmWorker Dimension using ResourceView

    Hi Alex C.

    Might be possible the below link helps you.

    d365technext.blogspot.com/.../how-to-get-employee-dimensions.html

  • Alex C Profile Picture
    84 on at
    RE: How to get HcmWorker Dimension using ResourceView

    Hi André,

    Thanks for the reply. I looked at the DimensionAttributeLevelValueView and it seems promising. However, I can't seem to find the relationship between this view and the ResourceView which contains the DefaultDimension & ResourceId of the worker.

    Resource view

    Not sure where to be adding the new view. I was also thinking of creating a string computed column but I am also struggling to create the code to fetch the value. Also this latter approach may not be the best as I would be querying for each record.

    Let me know what you think,

    Thanks!

  • André Arnaud de Calavon Profile Picture
    299,397 Super User 2025 Season 2 on at
    RE: How to get HcmWorker Dimension using ResourceView

    Hi Alex,

    Have you tried to map the DefaultDimension field with the AttributeValueRecId field in this view?

  • Alex C Profile Picture
    84 on at
    RE: How to get HcmWorker Dimension using ResourceView

    Hi André,

    I have tried to map it to the AttributeValueRecId but had no results. I then tried to map it to the "ValueCombinationRecId". This seems to be pulling dimensions but not from the employee ResourceId found in the ResourceView view. I am thinking that the DefaultDimension I added to the ResourceView view is not the one belonging to HcmWorker.

    I will continue my investigation and report back.

    Thanks

  • Alex C Profile Picture
    84 on at
    RE: How to get HcmWorker Dimension using ResourceView

    André,

    In an attempt to find how the HcmWorker form creates the financial dimensions of an employee, I found that it uses a "Dimension Entry Control". However I can't seem to find the source of the information for it to be populated. Using my previous method of the ResourceView's default dimension, I couldn't get the proper dimensions displayed.

    Here is an example of what I currently have in the Posted Project Transactions form with a display method:

    postedProjectTrans.jpg

    I have the ResourceId of the worker. I guess now I'm back to square one trying to figure out how to fetch the DefaultDimension of a HcmWorker.

    hcmWorkerEmployment.jpg

    Do you think I should keep trying with the DimensionAttributeLevelValueView? Apologies if I'm turning in circles.

    Thanks again for your help & advice.

  • Suggested answer
    Alex C Profile Picture
    84 on at
    RE: How to get HcmWorker Dimension using ResourceView

    I have solved this by creating a view called HcmWorkerDimensions. See below:

    hcmWorkerDimensions.jpg

    I then use my view to join to the ResourceView view. Once that is done, I can add the DisplayValue of the dimension on the ProjProjectTransactionsListPage form.

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    299,397 Super User 2025 Season 2 on at
    RE: How to get HcmWorker Dimension using ResourceView

    Hi Alex,

    Apologies. I mentioned the wrong view. You can use DimensionAttributeValueSetItemView.

    The field DimensionAttributeValueSet contains the reference ID for the DefaultDimension field.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 2,028

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 878 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 579 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans