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
  • +1
    Certified Lead Developer

    Can you tell us more about your use case?

    As Stewart mentioned, the a!writeToDataStoreEntity()* function writes to the DB upon the execution of any save action, so it might be helpful for you to describe what you want to accomplish, what you've tried already, and what you're having issues with.

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    The form had two buttons, Save for Later and Submit. On Save For Later, user didn't want to navigate away from UI. The form is divided into multiple parts for being a huge form. Every part has "Save for Later" which we wanted to save data in DB without navigating away.

  • 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.

Reply
  • 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.

Children
No Data