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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Portal - Retrieve Pare...
Power Pages
Unanswered

Portal - Retrieve Parent entity fields on child record

(0) ShareShare
ReportReport
Posted on by 184

Hello

 

I have a case entity and a custom entity. In portal web page when I create a new custom entity record, I am looking to populate the child entity’s “name” field with Case Number field from Case. How do I access parent entity fields?

 

Could you advise please?

 

Thanks

Vik

Categories:
  • - Matt Bayes - Profile Picture
    91 on at

    Hi Vik,

     

    It sounds like you have a few options depending on your requirements.

     

    If you do not need to present the user with the "name" field populated when creating the custom entity, you can write a workflow inside of Dynamics 365 to populate this value "On Create" of the custom entity. Similar to this, you could write a plugin to do the same if a code-first approach is preferred.

     

    If you need to display the value to the user when they are creating the record, there are a few ways you can get the information, however, they most likely all require some sort of customization.

     

    First, you could utilize a Web Template with a FetchXml tag to retrieve the parent record and return back the field(s) you need in JSON format. You could then call this via JS/JQuery and populate the field on the child record.

    Alternatively, you could use a Web Template for the custom entity create page that would be able to retrieve the parent entity, bind the field(s) you need to a hidden HTML section, and then you can retrieve those fields via JS on the child entity create webpage. I think this would be easier since you will only have one parent record and do not need to do an additional query into CRM for the information. Here's an example:

     

    {% assign case = entities["incident"][request.params.parentid] %}
    
    <div class="hidden">
     <p id="caseName">{{case.name}}</p>
    </div>

     

    In your JS code you could do something like the following:

    let caseName = $("#caseName").text();
    
    $("#custom_number").val(caseName);

     

    This would retrieve the hidden parameter and populate it into the "custom_number" field (or whatever it is called in your case) for your child entity.

     

    Using out-of-box functionality unfortunately there is no way you could populate it using Entity Metadata unless the "Case Name" was stored on the Contact record, as this is available when populating values.

     

    If you need any more assistance or have questions please don't hesitate to reach out!

    Thanks!

     

    Matt Bayes

  • Fubar Profile Picture
    17 Super User 2026 Season 1 on at

    It does depend on a number of factors, one way is to implement a quick view form (for the Case) include the fields on that form (e.g. Case Number) and then display it on the child form (i.e. put the quick view on the child form linked to the Lookup to Case), when the user submits (creates) the child record use a workflow to copy the value from the parent record into the name field of the child.

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!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 35

#2
M Bilal Khan Profile Picture

M Bilal Khan 33

#3
11manish Profile Picture

11manish 21 Super User 2026 Season 2

Last 30 days Overall leaderboard