Any way to prevent intermediate table refresh

I have a table (using SQL Server) that requires that an update query and then an insert query be run on Save Changes. The JS query executed looks like

UpdateExistingContactRows.trigger();
InsertExistingContact.trigger()
.then(() => {
GetFirmContacts.trigger();
});

The update may or may not execute based on the values in the recordUpdates array, the insert always runs but may not insert anything. The Get is the table refresh.

When save changes is pressed, the table refreshes and displays the original column data for a several seconds while the queries execute. Once the Get runs the table resyncs and displays the updates correctly.

Is there any way to prevent the changes from getting wiped out changes prior to the resync? I am getting complaints from users that they are becoming confused. (I have seen postings about custom save button but not sure if the answer.) Thanks.

Hey @pushbtn! Our devs are currently looking into adding a feature to tables so that their changes don't reset until new values have been fetched. We'll let you know here when there's an update!

In the meantime can you try returning the second query trigger? i.e.

UpdateExistingContactRows.trigger();
return InsertExistingContact.trigger()
.then(() => {
GetFirmContacts.trigger();
});

That should make your save query run until the Get finishes.

1 Like

Thank you. The return fixed the issue I was seeing.

Hey! Just want to give a quick update here that we've pushed a fix so that this pattern should be better supported natively in the UI!

Hi @Kabirdas - can you please confirm if the fix that was pushed to better support the query pattern on Save described in this post applies to Legacy Tables or just the current / new Table object? Thanks!

@bwdsl Thanks for asking! The fix was for the legacy table but we also included this setting on the new table -- although the wording is a bit different.

This is the setting in the new table (Click on the save actions add-on to view):

This is the setting on the legacy table under Advanced: