1
0
-1

We have a 5 page form which has "Background Save on Page Change" feature enabled. In page 5, we wanted to invoke a service before submitting the complete form. Service requires all the form data before submission.

Background save did not save the data on the last page (Data for first 4 page is saved and not the 5th page).

So before retrieving the data from the Transaction object, we wanted to perform a explicit save function.

Logic is like the below one,

Form.backgroundSave();
// Invoke service call with the form data (transaction data)
if(service call is successful) {
	Form.submit(item.properties.submissionMethod, item.properties.legacyMethod);
}

We used the below methods and did not work,

  1. Form.backgroundSave();
  2. Form.submit('Saved', false, true);

Can you help us to verify the syntax and guide us?


    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi,

      You only need to call Form.backgroundSave(), because it performs a submit, but backgroundSave returns a promise, so you need to use like this:

      Form.backgroundSave().then(function (data) {
          // here you can access the data object returned by the backgroundSave promise
      });

      If the backgroundSave call is successful, the .then callback receives an object with values like the screenshot below.

        CommentAdd your comment...