Person account related list problem

  • 1
  • Problem
  • Updated 5 years ago
I have person accounts and have created the account detail page which works fine. When I try to add a related list the system stops showing me the account detail information for the record I select for previewing. Not sure what is happening.

I get as far as Account ID is contact, select a contact, then the preview doesn't show the contact details but does show the related list information.

Any ideas?
Photo of Marshall

Marshall

  • 120 Points 100 badge 2x thumb
  • confused

Posted 5 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
90% probability that the problem is in your condition statements on your Account model or on the "related list" model. Can you give us a little more detail about the model conditions you have established on the page?
Photo of Marshall

Marshall

  • 120 Points 100 badge 2x thumb
I figured that would be the most likely spot for an error but can't figure it out after trying lots of times... my accounts tab works fine when I set it up alone as a Tab page and a Detail page.

The first condition is 1: Id = (param) id Very straight forward and when this was the only model, everything worked as expected.

the next model I added was for a custom object called consultations. The condition is 1: Patient__c = (param) id Patient__c is a reference for Contact. This is the model I'm trying to add into the related list tab. After I add this one and then preview, I only get the related list and the account info is empty.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
The basic problem is that you are asking for two parameter conditions - and the second one is not returned in the URL.

While I'm not familiar with Person Accounts, a quick read-up on them suggests that there is a one to one relationship between the person account and the contact.

I think you will need to do the following:

1. Create a model that retrieves the contact associated with the person account retrieved by your first condition.

  • New Model should be refer to the contact object

  • Condition should be "Contact Records where ID is the value of the Contact ID field from the first row returned by the Account model.

  • Please note you will be using the "Field from another Model" value in the content property of the Value section of the condition builder.


2. Adjust your Consultation Model so that it retrieves rows from Consultation__c where the Patient__c is the same as the contactID field returned in the Contact model.

  • Condition should be "Consultation__c records where Patient__c is the value of the ContactID field from the first row returned by the Contact model

  • Note again that you will be using the "Field from another Model" value in the content property of the Value section of the condition builder.


Now, your specific model names and field names may be different, but hopefully this gets you where you need to go.

In my opinion filter logic is the most mind bending part of working with any database - and while Skuid does a great job at providing natural language mechanisms for creating these filters, you still have to do all the mind bending.
Photo of Marshall

Marshall

  • 120 Points 100 badge 2x thumb
Hi Rob,

Thanks for the help so far. Getting closer... that took me a while to try so now I'm too far invested to give up.

So now I have 3 models and 3 conditions. The resulting page shows me my Patient details and the related list both at the same time which is a move in the right direction. Problem is that the related list for Consultations shows consultations for all Patients instead of just the single patient I'm trying to look up.

Going backwards from the third model (makes the most sense in describing)
-Consultation is pulling the consultation__c records where patient__c is the Id from NewModel. Source model is NewModel

-NewModel is pulling the contact records where Id is the value of the Id field from the blah blah Accounts model. Source is Accounts

-Accounts is pulling the Account records where the Id is the Id Parameter in the pages URL..

Seems like the Consultation model is not limiting itself to only the Patients from NewModel.

Anything I'm missing that stands out?

Cheers,

MP