UI field in editor inside a tab is not changing after updateRow in model through javascript

  • 1
  • Question
  • Updated 3 years ago
I have a javascript event handler like so that listens to an event that is raised elsewhere in the application, but that updates the Client model zip_code__c field with what is passed in the eventDetails.

The code above is working correctly in that it it gets triggered and updates the model when the event occurs, however, the field in the UI is still displaying the old data.

Note that the field is in an Editor inside of Tab.  Not sure if that would matter.
I was under the impression that the editor would detect the change in the model and display the change automatically.  Why would this not be occurring.

Thanks in advance.
Photo of Sofware Developer Guy

Sofware Developer Guy

  • 1,384 Points 1k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Amy Dewaal

Amy Dewaal, Official Rep

  • 8,320 Points 5k badge 2x thumb
Software Developer Guy,

The changes aren't getting reflected because you still need to save the model after you update the rows. Right after "model.updateRow( row1, fielsToUpdate);" add "model.save();" Check out the comment on this community post to see how you can also add a callback function to the save method to confirm that your model saved without error.

Photo of Matt Sones

Matt Sones, Champion

  • 32,106 Points 20k badge 2x thumb
If you don't want to save, you can also forcibly re-render the field editor that still shows the old data, like so: