You've accurately described a common limitation with SubGrids in Dynamics 365 forms when you uncheck "Show Related Records" and try to add new records. The native behavior indeed breaks the parent-child relationship mappings when you move away from the "Show Related Records" functionality.
Let's break down the situation and explore solutions:
Understanding the Problem:
Solutions:
Xrm.Navigation.openForm
(Recommended):
Xrm.Navigation.openForm
.your_relationship_name
, your_child_entity_name
, your_lookup_field_name
) with your actual values.openChildRecordForm
).
Recommendation:
Xrm.Navigation.openForm
(Option 1) is the recommended approach. It provides the most reliable and direct way to ensure that the lookup field is populated correctly when adding new records from a SubGrid with custom filters.By using the JavaScript customization, you can effectively address the limitation of parent-child relationship mappings when using custom filters in SubGrids. Remember to test thoroughly and consider the user experience.
Holly Huffman
103
Muhammad Shahzad Sh...
96
Most Valuable Professional
Gerardo RenterÃa Ga...
51
Most Valuable Professional