I see that at 100.4, QueryRelatedFeaturesAsync works with m:n relationships in a MMPK, at least in one direction. However, it still fails in the reverse direction with an "Item not found in the database" exception. Is this known behavior?
I figured it out!!!! QueryRelatedFeaturesAsync will not work if the FeatureLayer is a sublayer of a GroupLayer. Here's the example code:
<SPAN class="keyword token">using</SPAN> System<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">using</SPAN> System<SPAN class="punctuation token">.</SPAN>Collections<SPAN class="punctuation token">.</SPAN>Generic<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">using</SPAN> System<SPAN class="punctuation token">.</SPAN>IO<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">using</SPAN> System<SPAN class="punctuation token">.</SPAN>Linq<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">using</SPAN> System<SPAN class="punctuation token">.</SPAN>Text<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">using</SPAN> System<SPAN class="punctuation token">.</SPAN>Threading<SPAN class="punctuation token">.</SPAN>Tasks<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">using</SPAN> System<SPAN class="punctuation token">.</SPAN>Windows<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">using</SPAN> Esri<SPAN class="punctuation token">.</SPAN>ArcGISRuntime<SPAN class="punctuation token">.</SPAN>ArcGISServices<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">using</SPAN> Esri<SPAN class="punctuation token">.</SPAN>ArcGISRuntime<SPAN class="punctuation token">.</SPAN>Data<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">using</SPAN> Esri<SPAN class="punctuation token">.</SPAN>ArcGISRuntime<SPAN class="punctuation token">.</SPAN>Mapping<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">using</SPAN> Esri<SPAN class="punctuation token">.</SPAN>ArcGISRuntime<SPAN class="punctuation token">.</SPAN>UI<SPAN class="punctuation token">.</SPAN>Controls<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">namespace</SPAN> RelTest <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">static</SPAN> <SPAN class="keyword token">class</SPAN> <SPAN class="token class-name">MobileMapTest</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">static</SPAN> <SPAN class="keyword token">readonly</SPAN> <SPAN class="keyword token">bool</SPAN> bAddGroupLayers <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">const</SPAN> <SPAN class="keyword token">string</SPAN> sMMPKPath <SPAN class="operator token">=</SPAN> <SPAN class="string token">@"C:\apps\FieldApp\Data"</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">static</SPAN> <SPAN class="keyword token">readonly</SPAN> <SPAN class="keyword token">string</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">]</SPAN> MMPKNames <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="string token">"AZLandbase.mmpk"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"AZGas.mmpk"</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">const</SPAN> <SPAN class="keyword token">int</SPAN> iMapIndex <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">const</SPAN> <SPAN class="keyword token">int</SPAN> iRelID <SPAN class="operator token">=</SPAN> <SPAN class="number token">4</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">const</SPAN> <SPAN class="keyword token">string</SPAN> sForwardTableName <SPAN class="operator token">=</SPAN> <SPAN class="string token">"RegulatorStation"</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">const</SPAN> <SPAN class="keyword token">int</SPAN> iForwardFeatureID <SPAN class="operator token">=</SPAN> <SPAN class="number token">2912</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">public</SPAN> <SPAN class="keyword token">static</SPAN> <SPAN class="keyword token">async</SPAN> Task <SPAN class="token function">OpenMMPK</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="comment token">// Open mobile map</SPAN> MapView mv <SPAN class="operator token">=</SPAN> MainWindowModel<SPAN class="punctuation token">.</SPAN>Current<SPAN class="punctuation token">.</SPAN>MapViewContainerContent<SPAN class="punctuation token">;</SPAN> Map MyMap <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Map</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> Viewpoint vp <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">foreach</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">string</SPAN> sMMPKName <SPAN class="keyword token">in</SPAN> MMPKNames<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">string</SPAN> sMMPK <SPAN class="operator token">=</SPAN> Path<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Combine</SPAN><SPAN class="punctuation token">(</SPAN>sMMPKPath<SPAN class="punctuation token">,</SPAN> sMMPKName<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> MobileMapPackage mmpk <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">await</SPAN> MobileMapPackage<SPAN class="punctuation token">.</SPAN><SPAN class="token function">OpenAsync</SPAN><SPAN class="punctuation token">(</SPAN>sMMPK<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> Map map <SPAN class="operator token">=</SPAN> mmpk<SPAN class="punctuation token">.</SPAN>Maps<SPAN class="punctuation token">[</SPAN>iMapIndex<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>vp <SPAN class="operator token">==</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">)</SPAN> vp <SPAN class="operator token">=</SPAN> map<SPAN class="punctuation token">.</SPAN>InitialViewpoint<SPAN class="punctuation token">;</SPAN> LayerCollection Sublayers<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>bAddGroupLayers<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> GroupLayer gLyr <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">GroupLayer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> Name <SPAN class="operator token">=</SPAN> Path<SPAN class="punctuation token">.</SPAN><SPAN class="token function">GetFileNameWithoutExtension</SPAN><SPAN class="punctuation token">(</SPAN>sMMPKName<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> Id <SPAN class="operator token">=</SPAN> Guid<SPAN class="punctuation token">.</SPAN><SPAN class="token function">NewGuid</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">ToString</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> IsVisible <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">true</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">;</SPAN> MyMap<SPAN class="punctuation token">.</SPAN>OperationalLayers<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Add</SPAN><SPAN class="punctuation token">(</SPAN>gLyr<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> Sublayers <SPAN class="operator token">=</SPAN> gLyr<SPAN class="punctuation token">.</SPAN>Layers<SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">else</SPAN> Sublayers <SPAN class="operator token">=</SPAN> MyMap<SPAN class="punctuation token">.</SPAN>OperationalLayers<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">foreach</SPAN> <SPAN class="punctuation token">(</SPAN>Layer lyr <SPAN class="keyword token">in</SPAN> map<SPAN class="punctuation token">.</SPAN>OperationalLayers<SPAN class="punctuation token">.</SPAN><SPAN class="token function">ToList</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> map<SPAN class="punctuation token">.</SPAN>OperationalLayers<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Remove</SPAN><SPAN class="punctuation token">(</SPAN>lyr<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> Sublayers<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Add</SPAN><SPAN class="punctuation token">(</SPAN>lyr<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> MyMap<SPAN class="punctuation token">.</SPAN>InitialViewpoint <SPAN class="operator token">=</SPAN> vp<SPAN class="punctuation token">;</SPAN> mv<SPAN class="punctuation token">.</SPAN>Map <SPAN class="operator token">=</SPAN> MyMap<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">await</SPAN> MyMap<SPAN class="punctuation token">.</SPAN><SPAN class="token function">LoadAsync</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">public</SPAN> <SPAN class="keyword token">static</SPAN> <SPAN class="keyword token">async</SPAN> Task <SPAN class="token function">QueryTest</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="comment token">// Get feature layer</SPAN> MapView mv <SPAN class="operator token">=</SPAN> MainWindowModel<SPAN class="punctuation token">.</SPAN>Current<SPAN class="punctuation token">.</SPAN>MapViewContainerContent<SPAN class="punctuation token">;</SPAN> FeatureLayer fLyr <SPAN class="operator token">=</SPAN> <SPAN class="token function">FindLayer</SPAN><SPAN class="punctuation token">(</SPAN>mv<SPAN class="punctuation token">.</SPAN>Map<SPAN class="punctuation token">.</SPAN>OperationalLayers<SPAN class="punctuation token">,</SPAN> sForwardTableName<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>fLyr <SPAN class="operator token">==</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">return</SPAN><SPAN class="punctuation token">;</SPAN> ArcGISFeatureTable fTab <SPAN class="operator token">=</SPAN> fLyr<SPAN class="punctuation token">.</SPAN>FeatureTable <SPAN class="keyword token">as</SPAN> ArcGISFeatureTable<SPAN class="punctuation token">;</SPAN> <SPAN class="comment token">// Get feature for forward test</SPAN> QueryParameters qp <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">QueryParameters</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> qp<SPAN class="punctuation token">.</SPAN>ObjectIds<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Add</SPAN><SPAN class="punctuation token">(</SPAN>iForwardFeatureID<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> FeatureQueryResult queryResult <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">await</SPAN> fTab<SPAN class="punctuation token">.</SPAN><SPAN class="token function">QueryFeaturesAsync</SPAN><SPAN class="punctuation token">(</SPAN>qp<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> ArcGISFeature feat <SPAN class="operator token">=</SPAN> queryResult<SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">as</SPAN> ArcGISFeature<SPAN class="punctuation token">;</SPAN> <SPAN class="comment token">// Get forward M:N relationship</SPAN> RelationshipInfo relInfo <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">foreach</SPAN> <SPAN class="punctuation token">(</SPAN>RelationshipInfo info <SPAN class="keyword token">in</SPAN> fTab<SPAN class="punctuation token">.</SPAN>LayerInfo<SPAN class="punctuation token">.</SPAN>RelationshipInfos<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>info<SPAN class="punctuation token">.</SPAN>Id <SPAN class="operator token">!=</SPAN> iRelID<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">continue</SPAN><SPAN class="punctuation token">;</SPAN> relInfo <SPAN class="operator token">=</SPAN> info<SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="comment token">// Forward related query test</SPAN> <SPAN class="comment token">// 100.5 BUG: This will fail if the feature layer is a sublayer of a group layer</SPAN> RelatedQueryParameters param <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">RelatedQueryParameters</SPAN><SPAN class="punctuation token">(</SPAN>relInfo<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">bool</SPAN> bForwardSuccess <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">;</SPAN> IReadOnlyList<SPAN class="operator token"><</SPAN>RelatedFeatureQueryResult<SPAN class="operator token">></SPAN> Results <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">await</SPAN> fTab<SPAN class="punctuation token">.</SPAN><SPAN class="token function">QueryRelatedFeaturesAsync</SPAN><SPAN class="punctuation token">(</SPAN>feat<SPAN class="punctuation token">,</SPAN> param<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>Results <SPAN class="operator token">==</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">)</SPAN> bForwardSuccess <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">false</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">else</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>Results<SPAN class="punctuation token">.</SPAN>Count <SPAN class="operator token">==</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN> bForwardSuccess <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">false</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">else</SPAN> <SPAN class="punctuation token">{</SPAN> RelatedFeatureQueryResult relResult <SPAN class="operator token">=</SPAN> Results<SPAN class="punctuation token">.</SPAN><SPAN class="token function">FirstOrDefault</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> bForwardSuccess <SPAN class="operator token">=</SPAN> <SPAN class="punctuation token">(</SPAN>relResult<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Count</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">></SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> StringBuilder sb <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">StringBuilder</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> sb<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Append</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Query test (with"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="operator token">!</SPAN>bAddGroupLayers<SPAN class="punctuation token">)</SPAN> sb<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Append</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"out"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> sb<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Append</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">" group layers): "</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>bForwardSuccess<SPAN class="punctuation token">)</SPAN> sb<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Append</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Success"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">else</SPAN> sb<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Append</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Fail"</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> MessageBox<SPAN class="punctuation token">.</SPAN><SPAN class="token function">Show</SPAN><SPAN class="punctuation token">(</SPAN>sb<SPAN class="punctuation token">.</SPAN><SPAN class="token function">ToString</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">private</SPAN> <SPAN class="keyword token">static</SPAN> FeatureLayer <SPAN class="token function">FindLayer</SPAN><SPAN class="punctuation token">(</SPAN>IEnumerable<SPAN class="operator token"><</SPAN>Layer<SPAN class="operator token">></SPAN> Layers<SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">string</SPAN> sTableName<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">foreach</SPAN> <SPAN class="punctuation token">(</SPAN>Layer lyr <SPAN class="keyword token">in</SPAN> Layers<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>lyr <SPAN class="keyword token">is</SPAN> FeatureLayer fLyr<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="operator token">!</SPAN><SPAN class="punctuation token">(</SPAN>fLyr<SPAN class="punctuation token">.</SPAN>FeatureTable <SPAN class="keyword token">is</SPAN> ArcGISFeatureTable fTab<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">continue</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>fTab<SPAN class="punctuation token">.</SPAN>TableName <SPAN class="operator token">!=</SPAN> sTableName<SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">continue</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">return</SPAN> fLyr<SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">else</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>lyr <SPAN class="keyword token">is</SPAN> GroupLayer gLyr<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> FeatureLayer fl <SPAN class="operator token">=</SPAN> <SPAN class="token function">FindLayer</SPAN><SPAN class="punctuation token">(</SPAN>gLyr<SPAN class="punctuation token">.</SPAN>Layers<SPAN class="punctuation token">,</SPAN> sTableName<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>fl <SPAN class="operator token">==</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="keyword token">continue</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="keyword token">return</SPAN> fl<SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="keyword token">return</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
At 100.5, no m:n related features are returned at all from a mmpk.
Now my mmpk queries are working fine in both directions. I don't know what I was doing wrong before.
Also, querying m:n related features from a service feature table exhibits interesting behavior:
1) If a related feature is found, multiple duplicate results are returned
2) If a related feature is not found, the query throws an "Item not found in database" exception
3) Nonetheless, the query does work in both directions, M>N and N>M.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.