Skip to main content

Notifications

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!!

  • D365 ER Profile Picture
    D365 ER 167 on at
    RE: how to compare the worker financial dimension value with the project financial dimension value.

    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.

  • D365 ER Profile Picture
    D365 ER 167 on at
    RE: how to compare the worker financial dimension value with the project financial dimension value.

    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.

  • Verified answer
    GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: how to compare the worker financial dimension value with the project financial dimension value.

    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
    D365 ER 167 on at
    RE: how to compare the worker financial dimension value with the project financial dimension value.

    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!!

  • GirishS Profile Picture
    GirishS 27,821 Super User 2024 Season 1 on at
    RE: how to compare the worker financial dimension value with the project financial dimension value.

    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.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,074 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,900 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans