Header Ads Widget

Title: Fixing Reference Group Control Issues in D365FO Forms x++

 

Working with Reference Group controls in Microsoft Dynamics 365 Finance and Operations (D365FO) can be tricky, especially when migrating from older AX 2012 practices. If you're struggling to get a proper lookup for foreign key fields using Reference Groups, you're not alone. This blog documents the issue and provides a clear step-by-step solution.


🔍 Issue:

You’re trying to use a Reference Group to create a lookup for a foreign key (e.g., BillingPostalAddress) in D365FO, but the expected behavior isn't working—even though you followed AX 2012 guidelines.


✅ Solution: Setting Up Reference Groups Properly in D365FO

Here’s how to do it correctly in D365FO:










1️⃣ Create a Foreign Key Relation on the Child Table

  • Go to your child table

                                                


  • Create a new relation to the parent table (e.g., LogisticsPostalAddress).

                        

  • Select the proper related field (typically a RecId from the parent table).



  • Once you select the Index, D365FO will:

    • Create a new RecId field.

    • Generate a new index for the RecId.

    • Establish a relationship to the referenced table.



⚠️ Note: If you prefer to use your own field (e.g., BillingPostalAddress), delete the auto-generated fields, index, and relation. Then manually create them using your specific field.




2️⃣ Add Field to Form and Use Reference Group

  • Open the form where the lookup is needed.

  • Drag and drop the field (e.g., BillingPostalAddress) into the appropriate Field Group.

  • The control will automatically become a Reference Group.






3️⃣ Update Reference Group Properties



  • Select the new Reference Group control.

  • Set the Replacement Field Group property to show the desired fields from the parent table.

🎉 Done! Your Reference Group control will now correctly display a lookup using values from the related table.


💡 Pro Tips

  • Always confirm that your relation uses a valid RecId and index combo.

  • Ensure your parent table has a properly defined Field Group for lookup replacement.

  • Rebuild and synchronize your project after creating the relation and dragging the field.


🧾 Summary Table

StepDescription
1. Foreign KeyCreate a relation using the RecId of the parent table
2. Field ControlAdd the field to the form and use it as a Reference Group
3. Replacement GroupSet the field group to display in the lookup

💬 Got Questions?

Feel free to drop a comment or reach out to me at masteringdynamics365fo@gmail.com.

Stay tuned for more technical insights on D365FO development!


Post a Comment

0 Comments