Skip to Content
0

SimpleForm to be saved as draft until "Submit" button is clicked

May 03, 2017 at 09:04 AM

196

avatar image

Hello Experts,

I have a requirement in which , there is a SimpleForm , with some fields . The user may fill some of the input fields in the SimpleForm and decide to close the app. When he reopens the app , he should get the same SimpleForm with the input fields filled with the values , he placed the last time.(i.e. the same instance of SimpleForm should get reloaded).

In short the SimpleForm should be stored as a draft until the user submits the details by clicking the "SUBMIT" button. Is it feasible to do so??

Is it possible to save this SimpleForm's immediate vrsions and reload it with same details that was filled earlier?

Thanks and Regards

Aman Anand

10 |10000 characters needed characters left characters exceeded
Former Member

Hi Anand,

I need like same scenario what you mentioned on your post,if you done that task then please will you elaborate that............

Thanks & Regards

Priya

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Akhilesh Upadhyay May 03, 2017 at 11:12 AM
0

there is a design guideline for "Draft handling", check this link draft-handling

you can follow steps as i have done for one app:

  1. Create draft (duplicate) database tables
  2. while creating data /open view in app, create a draft entry with blank values
  3. at particular event (tab change, time interval etc.) from front end update draft tables
  4. every time data if exists should come from draft tables only
  5. on click of Submit button, Update the draft tables first and then process data from draft to original tables.
  6. once data is processed from Draft to Original table, Delete the draft entry

uses:

oData model v2 or above is good to implement Draft handling

oModel.submitChanges() - to update respective draft tables

Import functions - to process data from draft to original tables

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Thanks Akhilesh for your reply. Can you please elaborate on the concept of duplicate tables as well as draft entry with blank values.

would really appreciate if you post that perticular code snippet.

Thanks

Aman

0
Former Member

Hi Anand,

I need like same scenario what you mentioned on your post,if you done that task then please will you elaborate that............

Thanks & Regards

Priya

0

Hi Priya

We used Pouch db for the draft storage.

0
avatar image
Former Member May 03, 2017 at 02:30 PM
0

Hi Anand,

The required functionality can be achieved with two oData services -

1) For Save/Submit ( pass filter parameter like A-Save , S-Submit)

2) Read the saved data. This service can also be used to read the submitted data by passing indicator Submit(S)

You can implement the logic for Save/Submit as explained from Akhilesh or same table you can use for Saving(A) and Submit(S) the data using an indicator.

Regards

Madhu

Share
10 |10000 characters needed characters left characters exceeded