Javascript model.save() doesn't pass the new values to Apex class

Hello, Using row action button, I’m calling the Javascript snippet and in that snippet, I’m saving the model and then calling the Apex class. In JS log, it’s showing the updated new value, but while querying in Apex, it’s taking the previous value which gives the faulty outcome. When I was using Save Action in SKuid UI earlier (without using model.save() in snippet),  it was taking the newly updated value. Please assist.

Are you calling the apex class in a callback inside model.save(), or calling it after model.save()? You need to use a callback to ensure that the save() updates the database.

Hello Mike, Thank you so much, When i called apex inside callback, it worked as expected. After this I’m facing one minor issue, in a row action button, after the snippet call action, i have few other actions like querying few models in the button action itself, looks like those are not getting executed automatically. Do you have any idea?

Hmm… Do you mean something like this?

If the Actions after the snippet depend on something that happens inside the snippet, you may have a problem. Can you perform those actions with javascript inside the snippet?

Hi Mike, Sorry for the delayed response.

yes, i’m referring to those actions, I have to ‘Query Models with Query behavior as Get more-merge new rows with old’ after that snippet. 

I tried using this below snippet, but it refreshes the whole table and closes the drawer. I want to execute refresh with action similar to  ‘Query Models with Query behavior as Get more-merge new rows with old’ 

 skuid.model.updateData([quickQuoteModel,quoteLines]);