Grid displaying data not always being refreshed

This is concerning grids where uit's data is sourced from the database through a!queryEntity.

What I wish to do is quite simple : the client wish to treat in batch many entities dusplayed through the grid. So I've activated the grid selection, where selection returns an array of ID's. The user can then click some buttons to set the selected rows to a specific state (it's actually a simple write entity to database update case).

The thing is the user wants to stay on the same UI and needs the grid to be refreshed when he clicks on such buttons.

The little trick I used is simple, in the save into property of the button I do a simple writeToMultipleDataStoreEntities. For each entity selected update and write to database. When the user clicks on the button --> all; is set properly in the DB and the gris refreshes : all good!

Now an extra operation has to be added, while doing the same thing we need to audit the modification, thus pushing a new entity in another datasource.

So I tried :

  1. On the writeToMultipleDataStoreEntities success callbhack, call a!writeToDataStoreEntity. Appian hates it, he wants to keep it aa single smart service at a time for an expression.
  2. Fine, so I try the same thing in parallel (i.e : saveInto: {a!writeToMultipleDataStoreEntities(...), a!writeToDataStoreEntity(...)}. Heck I though I could fool it for a second, same as 1 for results.
  3. Searched through forum, talked about Appian 16.3 fixing this issue? But we are in the 17.1 version and I still get the error so I don't quite understand the KB to be fair (can't find the link anymore sadly)
  4. Another idea from the forum which sounded like salvation : instead of doing all that simply launch a process (a!startProcess) from the saveInto and voila, call as much as write to database smart service you need within the process.

4 works ... but the grid doesnt refresh itself unlike when calling directly a!writeToMultipleDataStoreEntities from the saveInto.

I suppose this is because the process itself is another thread so doesn't impact the UI thread in some way?

I tried to insert a simple a!writeToDataStoreEntity onSuccess callback of the a!startProcess to force a grid refresh, yes I'm this desperate. Then again same result as in 1, of course.

Is there ANY way of doing this?

  • When clicking a button it updates the data where the grid feeds on and other data (so more than write into the DB)
  • At the same time the grid is updated from the UI
  • The button does not submit (thus staying on the same UI)

Thanks.

  Discussion posts and replies are publicly visible