Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Parent and Child Entity - Quick Create Populate Parent Lookup Field

(0) ShareShare
ReportReport
Posted on by 76
Hello,

I have 2 custom entities that behave like quote and quote product entities. 

Purpose of the solution: Hold reservation records for products that will have extended features not related at this step.

Parent entity: crcad_reservationrecord
Child entity: crcad_reservationproductdetail
Child entity has a many to one relationship with product entiy

In the reservationrecord main form I use an editable grid to add reservationproductdetail items. I'm using a quick create form to add reservation line item. I want to pre-populate the lookup field crcad_reservationrecord in the quick form when it's launched. I've been trying to use JS but hasn't been successful. I've read somewhere that with the correct relationship set up it should pre-populate without any customization. I've tried using both referantial and parental many to one relationship from reservationproductdetail to crcad_reservationrecord however it didn't work.

I'd appreciate your assistance.

Thanks.

Relationship Config:
r/Dynamics365 - Relationship Setup

Quick Form Config:
r/Dynamics365 - Form Fields


Lookup Column Config:

r/Dynamics365 - Lookup Column Setup

Editable Grid Config:

r/Dynamics365 - Editable Grid Setup
 
 
r/Dynamics365 - Editable Grid Setup 2


r/Dynamics365 - Editable Grid Setup 3



 
  • Verified answer
    BK-17051419-0 Profile Picture
    BK-17051419-0 76 on at
    Parent and Child Entity - Quick Create Populate Parent Lookup Field
    I've found the issue. "Show Related Records" must be enabled.
  • Suggested answer
    Tom_G Profile Picture
    Tom_G 108 on at
    Parent and Child Entity - Quick Create Populate Parent Lookup Field
    This certainly seems like a bug. Creating a parent/child relationship like this should automatically have the parent record referenced, provided you are creating the child from within the parent record (so clicking on the +New from a Reservation record that has already been created).
     
    A couple quick questions.
    1) Does anything map from the parent child down to the parent one automatically?
    2) Do you see different behavior if you add the child record from the Editable Subgrid VS a normal subgrid VS through the associated record menu? Does the mapping occur in any of those starting points?
    3) If you disable the quick create form, so a new record goes straight to the main form, does the parent record automatically get mapped?

     
    A few things you can try, I'll be curious if any of them help.
    • If the the mapping is working outside of the editable grid, then we can isolate the issue down to that control for some reason. I don't feel like this is the issue, though, because any subgrid adding a new record should use the same quick create form which should show the mapping
    • Try publishing both tables and your model driven app again, just to make sure everything is fully committed and available
    • Do you possibly have two lookup links to the parent reservation record, and the wrong field is on the form?
    • Try checking he field level mapping in the custom tables (more details below)
     
    We have the ability in CE to configure field level mappings between two tables, outside of the parent/child mapping that is automatically created. For example, you could create a custom [Account Type] field and have it automatically mapped to any Opportunity created from the Account record to have a default value. Minor note is that you have to create the child record from within the parent record for this mapping to work, and the fields should be populated as soon as your new child record form is opened.

     
    Steps to check field level mapping
    • Open your default solution in https://make.powerapps.com and switch it back to the classic editor (this is not available in the new solution experience as far as I know)
     
    • In the legacy solution editor, find your reservation table in the left side menu under "Entities" and expand the tree. You should see the options for columns, keys, forms, etc. I'm using the Account table as a sample since I don't have your tables in my own environment
     
    • Open the 1:N Relationships menu on the left, and find your relationship between the Reservation and Reservation Detail tables you created. Double click to open up the relationship settings. These should look familiar to you, as most of these are present in the screenshots above. However, the legacy editor gives us an option that the new one does not. On the left side, look for a menu option called "Mappings"
    • Mappings show the field mappings between the two tables. Ideally you should be able to see the parent/child field mapping present in this window. In my example, you can see how creating a contact from an Account record will automatically populated the following fields:
      • Account Reference as [Company Name]
      • Address 1 Information > Address 1 Information
      • Telephone 1 > Main Phone
      • Currency > Currency
     
    • Check the field mappings in your environment, and make sure the parent record maps down to the proper field on the child reservation detail. You can modify, delete, or add new mappings from this menu. So if it is not set, then create the new mapping (it's relatively straightforward and just picking the two fields from a list), save and publish the table.

     
    Let me know how it goes, I'll be curious if any of this helps. This should absolutely be doable without any JS or plugins or any other tools as OOB CRM behavior, we just have to figure out why it's acting wonky for you.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey Pt 2

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,885 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,569 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans