I have the Account entity. It has a 1:N relationship with Contact and 1:N with Leads. (OOTB relationships)
Each Lead has a 1:N relationship with a custom entity named Claims.
My goal is to allow an external customer, a contact of the account, to use the portal and create claims on an existing lead for their account.
I have set up the portal and used the following entity permissions:
Permission 1: "My Accounts" - Contact Scope for Account entity
Permission 2: "My Account's Leads" - Account Scope for Lead entity
Permission 3: "My Account's Claims" - Account Scope for Claims entity.
On the portal, this successfully filters lists and lookups to those of the contact's accounts. Great.
Problem: There is an Account lookup on the Insert form for a Claim. When I set the account, I receive the following Yellow Screen of Death:
Sequence contains no elements
[InvalidOperationException: Sequence contains no elements]
System.Linq.Enumerable.First(IEnumerable`1 source) +405
Adxstudio.Xrm.Services.<GetDependencies>d__29.MoveNext() in G:\Agents\BA1256\_wap\83\s\Framework\Adxstudio.Xrm\Services\CacheDependencyCalculator.cs:331
System.Linq.<ConcatIterator>d__59`1.MoveNext() +637
System.Linq.<DistinctIterator>d__64`1.MoveNext() +79
System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +504
System.Linq.Enumerable.ToList(IEnumerable`1 source) +70
Adxstudio.Xrm.Services.OrganizationServiceCache.GetCachePolicy(Object query, Object result, Boolean invalidateDepedencies) in G:\Agents\BA1256\_wap\83\s\Framework\Adxstudio.Xrm\Services\OrganizationServiceCache.cs:0
When the account is left blank, this does not happen (successful submission). If the Contact is given Global scope for the Account entity, this does not happen. (debugging only)
This also does not happen for the lookup to select your existing lead, whether blank or filled out. That saves correctly.
I am developer, I know this is a Linq error. I have looked at the old, non-SaaS source code on Github, but these lines have been changed from that version.
I have tried various combinations of Parent-Child permissions. No luck.
I have cleared the portal cache, no luck.
There is no front-end customization, javascript, entity metadata, etc.
Any advice would be helpful.