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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

how to compare the worker financial dimension value with the project financial dimension value.

(0) ShareShare
ReportReport
Posted on by 167

Hi developers,

I have a requirement in which I am having a custom field at form which is showing some lookup values.

My requirement is I need to show the only the project id in lookup where cost center value of worker is equal to project cost center value.

Thanks!!

  • GirishS Profile Picture
    27,845 Moderator on at

    Hi D365 ER,

    You have one custom control which shows lookup of projId. So that lookup must be filtered to show projId if project cost center and worker cost center is same?

    Is that you are asking?

    Thanks,

    Girish S.

  • D365 ER Profile Picture
    167 on at

    Yes Girish, I have a custom control that already contains the lookup based on another criteria, I am trying to make onlookup event handler to add my functionality as well in the existing lookup.

    Thanks!!

  • Verified answer
    GirishS Profile Picture
    27,845 Moderator on at

    You can make use of DefaultDimensionView to get the financial dimension value against the particular financial dimension like Cost center.

    DefaultDimensionView will be having field called "Name" which will have "Cost center", "Department" etc.

    ProjTable and DefaultDimensionView will be related through DefaultDimension field.

    For Worker you need to consider HcmEmployment table.

    HcmEmployment and DefaultDimensionView will be related through DefaultDimension field.

    You can build the above as a lookup query and check.

    Thanks,

    Girish S.

  • D365 ER Profile Picture
    167 on at

    Hi Girish,

    Tried the same way but its not working.

    (Practice is one of the financial dimension)

    select RecId from employment

               where employment.Worker == worker.RecId

                   && worker.RecId == personalTimeOffRequest.CurrentWorker;

           dimensionValueWorkerTable =

       (select firstOnly DisplayValue from DefaultDimensionView

       where DefaultDimensionView.Name == #Practice

       && DefaultDimensionView.DefaultDimension == employment.DefaultDimension).DisplayValue;

           dimensionValueProjTable =

       (select firstOnly DisplayValue from DefaultDimensionView

       where DefaultDimensionView.Name == #Practice

       && DefaultDimensionView.DefaultDimension == projtable.DefaultDimension).DisplayValue;

    Thanks.

  • D365 ER Profile Picture
    167 on at

    Hi Girish ,

    The below code is working fine...

    Query query = new Query();

    QueryBuildDataSource qbds,qbds1;

    ProjTable projTable;

    DefaultDimensionView dimensionViewWorker;

    HcmEmployment employment;

    select * from employment

    where employment.Worker == 25678909//passs your curren worker from your custom table.

    join dimensionViewWorker

    where dimensionViewWorker.DefaultDimension == employment.DefaultDimension

    && dimensionViewWorker.Name == "CostCenter";

    qbds = query.addDataSource(tableNum(projTable));

    qbds1 = qbds.addDataSource(tableNum(DefaultDimensionView));

    qbds1.relations(false);

    qbds1.addLink(fieldNum(ProjTable, DefaultDimension),fieldNum(DefaultDimensionView, DefaultDimension));

    qbds1.addRange(fieldNum(DefaultDimensionView, DisplayValue)).value(queryValue(dimensionViewWorker.DisplayValue));

    //add code to SysTableLookup.

    Thanks.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 266 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 217

#3
Subra Profile Picture

Subra 164 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans