I am working on a project in Microsoft Dynamics Sales. This project involves creating custom components (at this stage using powerapp component framework) that can be added on a form as well as custom entities that are related too that component. What I would like to do is open the Leads form and have a component that displays a summary of all visits (my custom entity) related to the lead.
I am at the stage where I have the component (following this tutorial https://docs.microsoft.com/en-us/power-apps/developer/component-framework/implementing-controls-using-typescript) and have designed the init function to generate the html in the container (i.e. Labels and input fields). However, I am unsure on how I am supposed to pass data into these fields whenever a lead form is opened.
The entities are related using a lookup, and this is working as it should and the visit is referenced to a lead using the leads leadid on a field called new_new_parent_leadid.
What I hope to see is something as shown below:
https://i.imgur.com/C5qdBbq.png
Where visit count would be a count of all of the related visit entities to the given lead, and last updated would be the "Date Created" of the latest visit.
However, I am yet to find any good documentation on how I might achieve this. I am aware that I could create a rollup field on the Leads table and reference it to the visits table, but I don't want to create an extra column if I can avoid it. I also need to program the custom component myself rather than trying to modify the form through the designer.
Is there a way that I can I can get the data of the given lead, retrieve the "visits" based on the current leadid, then display this information on a powerapp component added to the lead table? Or is there an alternative I should use instead of the powerapp component to make these custom components?


Report
All responses (
Answers (