Form data does not refresh on requery of model

  • 1
  • Question
  • Updated 2 years ago
I have a Skuid form that doesn't display updated information even after the model containing the information is requeried. The form displays information on office locations (modeled as Accounts) of an organization (modeled as the parent Account of the offices) and the staff at those offices (modeled as Contacts). A popup on the form allows addition and editing of the staff Contacts. 
Also included on the form is a custom object called a GAR, which is used for tracking information on submission of the form by our users. When a contact record is saved on the popup, an action is triggered to set a status value on the GAR record to "Awaiting Validation". The save of this GAR record triggers a Process Builder linked to the GAR object to examine the data on the staff members for the organization to see if it meets our business rules. On completion of this examination, the appropriate values are written to two fields on the GAR record. These fields are configured to be displayed on the main form. The main form is configured to requery the GAR model on close of the popup.

When I save staff data on a popup form, I can verify by viewing the associated GAR record in its native Salesforce form that the appropriate data are being written to the GAR. However, the updated data do not display on the main form. Curiously, the render conditions of one of the display controls do work properly based on data in the GAR object.

Can someone help me get to the bottom of this?
Photo of Peter Larsen

Peter Larsen

  • 130 Points 100 badge 2x thumb
  • Frustrated

Posted 2 years ago

  • 1
Photo of Velvel Marasow

Velvel Marasow

  • 452 Points 250 badge 2x thumb
You might need to refresh the component that displays the data.
Try do a updateData() on the model that feeds the component that needs to be refreshed.
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Hi Peter,

After you've closed your popup, a good first step in troubleshooting is to browse the data in your models by opening your browser's console, and running the skuid.model.map() command. From there, drill down into the model in question, and you'll be able to see a data array with all of the records that are currently loaded from that object. If the new GAR records aren't listed there, you'll know that either the model's not being re-queried, or there may be some conditions on the model that are causing the new GAR records to be filtered out. 

Mark
Photo of Shmuel Kamensky

Shmuel Kamensky, Champion

  • 4,328 Points 4k badge 2x thumb
Peter,

If you know the data is properly updated and you also know that the skuid models are properly reflecting that data change, you can try manually refreshing the form with javascript.

var $ = skuid.$;
var form= skuid.component.getById('formId');
formtabs.render();
Sources: https://community.skuid.com/skuid/topics/rerender-tabset-with-javascript https://docs.skuid.com/latest/en/skui...
(Edited)