condition value changed, do I have to requery?

  • 1
  • Question
  • Updated 4 years ago
I'm looking to get further understanding on conditions. When a model has been loaded and then the condition value changed, does the model have to be requeried in order to display related records?

Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
You are correct Pat. Field from another model querys are not constantly being re-evaluated to see if the parent list has changed.  You will need to requery the model that is driving the related list in order for the changes in the parent model to be effected on the related records.  Add one more step to your action list...  
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,490 Points 10k badge 2x thumb
To further elaborate on what Rob said, you must also include the source model in your query request.  So in this case, if you changed a condition on the TDPUCurrentTask model and then wanted to get attachments for that task, you'd want to query both the TDPUCurrentTask model and the Attachments model in the same transaction.  If you were using the action framework you'd use a "Query Models" action, and if you were using the Skuid javascript API, you'd use the updateData method like this...

skuid.model.updateData([TDPUCurrentTaskModel,MyAttachementModel],function(){
    // Callback code here.
});