Is it possible to save into database without leaving the form?

Certified Senior Developer

I know about a!writetodatastore smart service function, is it possible that without navigating away from interface we are able to save the data in database using that function or is there some other way around.

  Discussion posts and replies are publicly visible

Parents Reply Children
  • To note, a trick you can use when you need to navigate away temporarily, such as uploading a document, saving data (with the Write to Datastore service), you can submit the form and chain through these other services, chain back to the form and it will appear to the user that they never left.  With something such as wizard type interfaces you can pass a reference back in as to where the user was viewing and re-load that section on return.

    Otherwise, the a!writeToDataStoreEntity() services works well when you can apply it within a save action.

  • 0
    Certified Lead Developer
    in reply to Chris
    To note, a trick you can use when you need to navigate away temporarily, such as uploading a document, saving data (with the Write to Datastore service), you can submit the form and chain through these other services, chain back to the form and it will appear to the user that they never left. 

    This is what I usually advise too - it means the data will be safely cached within the process instance, without having to write it to the DB early (sometimes before we're truly ready to).  It's probably the single most straightforward solution, as it requires very little modification to a form-and-process that was properly designed from the start.