What condition do I need to set so I can pull field history for a contact?

  • 1
  • Problem
  • Updated 3 years ago
  • Solved
I am trying to have a table on a contact record that shows the field history for this contact. I have read many of the post and I understand that it will not look the same as the native table but I can't get it to pull anything. I know it is the way I setup my conditions. I am building this on a contact detail page that I have tab set and one of the tabs I want to show the history of the contact.

The main condition is on the contact model that is Id=(param)Id

Condition I have tried on the History model:
ContactId = (Contact) Id
Contact.Id = (Contact) Id
ContactId = (param) ContactId
Contact.Id = (param) ContactId
ContactId = (param) Contact.Id
Contact.Id = (param) Contact.Id

I would love any suggestions. Thanks
Photo of Sierra Satow

Sierra Satow

  • 568 Points 500 badge 2x thumb

Posted 3 years ago

  • 1
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
I believe the issue is that you need to create a separate model on the contact_history object. Then you apply a condition on that model to restrict it to just the contact Id in context.
Photo of Sierra Satow

Sierra Satow

  • 568 Points 500 badge 2x thumb
That was what I was trying to do. The contact model has the param condition on it and the Contact
_History model I have used the conditions above and none of them brings up data. 
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Sorry, I missed that. The URL parameter is a page parameter and is the same for all models loaded on the page, so (param)Id should work for your history model too since that URL parameter is the Contact Id.
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Following your syntax Sierra, it should be:

ContactId = (param) id

Or in terms of the Model Condition setup, here's what it would be:

Salesforce SObject for your Model: ContactHistory

Condition Setup:
Field:
ContactId
Value: Page / URL Parameter Value, Parameter Name: id


Photo of Sierra Satow

Sierra Satow

  • 568 Points 500 badge 2x thumb
So I have setup the models with those conditions but it still is not pulling any information in. If I tell it to load on Model data on page load I just get the word "loading" on the page and nothing else happens. If it is not checked them the table comes up empty.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Your original post says that your contact model has a condition Id=(param)Id . Assuming that works on your contact model, that should mean that your URL parameter is "Id", not "id". Did you try ContactId= (param) Id with a capital i ?
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
If you remove all conditions on your history model, do any records populate?
Photo of Sierra Satow

Sierra Satow

  • 568 Points 500 badge 2x thumb
No I dont get any record to populate
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Seems like a problem with the model settings, not the condition. I think you should get some records in the absence of any conditions. If you are unable to get any records under any circumstances, it seems like a model level problem, not a condition level problem.
Photo of Sierra Satow

Sierra Satow

  • 568 Points 500 badge 2x thumb
So I removed the contact model and just have the ContactHistory model and if I preview it with the "Load Model Data on page load" checked then I get a  error.

JSON string exceeds heap size limit 

An unexpected error has occurred. Your solution provider has been notified. (System)

With that unchecked then I get the table but with no information populated
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
1) Also, do fields of your contact model populate? If not, it may be an issue with your URL not containing the actual contact Id as a parameter.
2) Look at the URL of the live page when you are previewing it and make sure it has the parameter "id" or "Id" in it and that the parameter is set equal to the actual Id of one of your existing contacts.
3) Make sure that contact has some changes in the history, otherwise there will be nothing to return.
4) check your model settings to make sure that something in there isn't causing the problem.

Other than that, I'm out of ideas. You have to wait for one of the guru's to chime in.
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,240 Points 5k badge 2x thumb
Hi Sierra~

Would you mind granting Skuid access to your organization so we can take a look at what's going on and get this addressed for you? Here is how to do that: 

1. Use this tutorial to give us login rights: http://help.skuidify.com/m/getting-started/l/182412-getting-help-how-to-grant-skuid-login-rights-to-your-org

2. Then send an email to support@skuidify.com with the following information: 
- Your org Id 
- The name of the page where the problem is happening 
- The steps required to reproduce the problem.  

We’ll see what’s going on... 

Thanks!
Karen
Photo of Karen Waldschmitt

Karen Waldschmitt, Official Rep

  • 8,240 Points 5k badge 2x thumb
Hi Sierra~

I am now able to see contact history on your page. Here is what I did on your contact history model:
  • Added a condition (it works with either ContactId from ContactHistory = Page/URL parameter Id OR using Field from another model based on Contact Id)
  • Checked the Load Model data on page load
  • Set 20 as the Max # of records
Happy New Year!
Karen