Skip to main content

Notifications

Customer Service forum
Suggested answer

get parent of parent id - look up field value in a calculated field

Posted on by 457

Hi 

I have a classification entity (similar to the product catalog ) that includes parent classification id. 

using this classification entity, i can create a product sector, product subsector, and product records.

Product is a child of product subsector. The product subsector is a child of the product sector. 

I try to rename the Colum tile of a view (image 1) using a calculated field following the instruction from the link, https://powerusers.microsoft.com/t5/Microsoft-Dataverse/Renaming-column-headers-in-an-entity-view/m-p/668202#M7018 

 I was able to create a calculated field to display Product sub sector (image 1). However, any suggestion on how can I get the Product Sector name (parent.parent.name). 

Thank you, Siva

image 1

pastedimage1626137951301v4.png

image 2

pastedimage1626137777360v3.png

Categories:
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: get parent of parent id - look up field value in a calculated field

    Hi SivaR,

    You can refer following link for calculated fields considerations:

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/define-calculated-fields?view=op-9-1#calculated-fields-considerations 

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • SivaR Profile Picture
    SivaR 457 on at
    RE: get parent of parent id - look up field value in a calculated field

    Thank you for the response. 

    Based on the current database structure, i am able to create a view to display product sub sector (classification.parentclassification as per image 1) and Product sector (parentclassification(classification).parentclassification as per image 2 ). However, the system doesn't allow me to create calculated field to select parentclassification(classification).parentclassification. Why it is working in view and not in the calculated field? 

    image 1

    pastedimage1626292153579v2.png

    image 2

    pastedimage1626292217686v3.png

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: get parent of parent id - look up field value in a calculated field

    Hi SivaR,

    As you mentioned, “Product is a child of product subsector. The product subsector is a child of the product sector.

    Maybe you can create a new 1:N relationship between Product and product sector, so one new product sector lookup field can be added into product entity.

    Then you can copy original product sector lookup field value from product subsector to new product sector lookup field of product automatically.

    Finally, you can create another new calculated field to display Product sector just like your previous operation for Product sub sector.

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

Helpful resources

Quick Links

Dynamics 365 Community Update

Welcome to the inaugural Community Platform Update. As part of our commitment to…

Dynamics 365 Community Newsletter - August 2024

Catch up on the latest D365 Community news

Community Spotlight of the Month

Kudos to Mohana Yadav!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,107 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,954 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans