It’s possible to get related records of a relationship when we retrieve a parent record using RelatedEntitiesQuery property in the RetrieveRequest. That means you have to construct the RetrieveRequest not using the Retrieve method from the OrganizationServiceProxy class.
Suppose we have 3 tables, Table A, Table B, and Table C related to each other as
Table A (n-1) Table B (n-1) Table C i.e.
Table A has a lookup of Table B and Table B has a lookup of Table C.
Below is our sample canvas app that has a gallery and a combo box.
What we would want is based on the Table C record’s name selected in the combo box, we want to filter the collection to only show those records that are related to it.
One of the ways we could implement this is by using the AddColumns to add Table C data to Table A and apply the Filter to it.
Below is the formula to achieve the same.
In Table A, add a column name “TableCName”.
To get the Table C name, perform a Lookup on Table B, where Table B GUID is equal to Table A’s Table B lookup field, and then fetch the Table C Lookup’s name from Table B.
And lastly, perform a Filter on this new column TableCName, based on the selected value in the combo box.
One of the reasons why throwing the InvalidPluginExecutionException doesn’t show up error dialog could be that you would have Profiled that step with profile storage as Persist to Entity.
Stop Profiling and it should work as expected.
Check for more details on InvalidPluginExecutionException –