I’m currently completely baffled about the following issue I’m currently having with some models. At a high level, what I’m aiming to do is Account Matching on a Lead detail page, if the Lead happens to be using our product. Here are the 3 SFDC objects/Skuid Models I’m working with and their relevant fields:
- Lead (Id field)
- Product_User__c (ProductUser is the Model name) (Lookups to Lead (Lead__c), Subscription__c, and Subscription__r.Account__c)
- Account (ProductUserAccounts is the Model name)
I am displaying one Lead Id per page (Condition: Id = param(Id)), up to 20 Product User rows, and only one ProductUserAccount. A Product_User__c record does not have to lookup to the Lead, but it does have to look up to a Subscription. However, for a ProductUser row to show in Skuid, it does have to be associated to the Lead we are viewing (Condition: Lead__c = (Lead)(Id)).
The Subscription (Subscription__c) that the ProductUser looks up to does not have to necessarily look up to an Account. However, it does have to look up to an Account for the ProductUserAccounts to display (this is where the confusion for me comes in).
So my Condition for the ProductUserAccounts is:
Id in (ProductUser)(Subscription__r.Account__c.Id). I am also limiting this model to just one row, prioritizing it based on how much the Account is paying.
Whenever there are ProductUser rows that look up to an Account, everything works properly. Example:
If there are no ProductUser rows, by default it means there should be no ProductUserAccounts (since it’s basing the Id off of the Subscription__r.Account__c.Id lookup relationship on the Product_User__c object). However, whenever this is the case, I’m getting a random Account to display (which has no Subscriptions, Product Users, etc. and is in no way related to the current Lead). Skuid displays the same exact account every single time.
Example: !(https://us.v-cdn.net/6032350/uploads/attachments/RackMultipart20160921-7320-1r97zn6-Match_Example Wrong inline.png “Image: https://d2r1vs3d9006ap.cloudfront.net/s3_images/1487022/RackMultipart20160921-7320-1r97zn6-Match_Example__Wrong__inline.png?1474496481”)
Any ideas? Is there something I’m doing wrong when trying to reference a field from another model in my ProductUserAccounts model condition? Why is it pulling this random ID?