I'm currently creating a canvas app with a dataverse database. I have the 2 following tables as part of the database:
- Opportunity
- Business Area
The opportunity table has a lookup field to the Business Area table which forms a 1-to-Many relationship.
I currently have a gallery which contains all Opportunities related to the currently selected Business Area. The gallery is populated using the following formula on it's Items property:
selectedBusinessArea.Opportunities
the gallery looks like this:
When I click on an item in the related list, a page containing an edit form for opportunities is shown, but the edit form only contains data for the Name and Description fields. The rest of the fields are blank. Here's a screenshot.
Opportunity details edit form, only the Name and description fields have any data
The edit form is populated using the following formula on it's items field.
If(newOpportunity, Defaults(Opportunities), selectedOpportunity)
in the formula above:
the newOpportunity variable is set to false when an item in the related Opportunities gallery is selected and the selectedOpportunity is set to the selected Item in the gallery when an item in the gallery is selected.
Does anyone have any idea why the Opportunity edit form is only partially loading the data in the edit form fields when trying to access it through the Opportunities related list on Business Areas.
A little Extra information:
The same issue doesn't occur when the data source of the gallery is set to the Opportunities table without any filters. Here is the result when using just the Opportunities table as the data source for the gallery.
Solved! Go to Solution.
@IdreesAnwar It could be due to the Explicit Column Selection Preview feature. You try turning it Off , although I would not recommend it as this will GA soon.
An Alternative would be to do an explicit LookUp rather than using the dot notation. Try this in the Items property (replace Key with the respective column names):
LookUp(Opportunities, Key=selectedBusinessArea.Key)
@IdreesAnwar It could be due to the Explicit Column Selection Preview feature. You try turning it Off , although I would not recommend it as this will GA soon.
An Alternative would be to do an explicit LookUp rather than using the dot notation. Try this in the Items property (replace Key with the respective column names):
LookUp(Opportunities, Key=selectedBusinessArea.Key)
@CNT Thanks for the solution, I couldn't find the Explicit Column selection preview feature. But i did try the lookup approach. The lookup approach did solve the issue, but as it only returns the one record the related list didn't contain all of the related opportunities. So, what i did instead was just use the filter function.
Filter(Opportunities, 'Business Area'.'Business Area' = selectedBusinessArea.'Business Area')
Thanks for the help
@CNT I've actually just tested the functionality again, it seems to have reverted back to the issue I was having before. This is very strange, The filter approach was working correctly just a couple of minutes ago and now I have the same issue again. I haven't changed anything since I fixed it?
@IdreesAnwar Filter returns a Table but you need only one record in the Item Property of the EditForm. That's why I told to use LookUp.
Also, you can find the Explicit Column Selection Preview feature here,
Oh right, i understand it now. So, just to detail the solution for anyone looking at this at a later date:
I have used the following filter on the Items property of the related opportunities gallery:
Filter(Opportunities, 'Business Area'.'Business Area' = selectedBusinessArea.'Business Area')
Then, for the OnSelected() event for the gallery i have used the following Lookup to get the full set of data for the opportunity that has been selected,
Set(selectedOpportunity, LookUp(Opportunities, Opportunity = ThisItem.Opportunity));
this now seems to be working. Thanks for the help @CNT.
ps: I've had a look in the upcoming features section but I the explicit column selection feature isn't in there. (not sure why)
User | Count |
---|---|
125 | |
87 | |
86 | |
75 | |
69 |
User | Count |
---|---|
216 | |
181 | |
140 | |
97 | |
83 |