Save data of new layout
I have created a new layout which replaces the Edit screen when the document is in a certain state in the lifecycle.
Submitting this form once again changes the state of the document.
However I am unable to see how to store the data from the new/ different fields in this layout when the user submits. What is the best way to achieve this?
thanks and regards
Yes to both your questions. It all began here http://answers.nuxeo.com/questions/2205/fill-up-a-form-when-the-document-state-is-to-be-changed-within-a-workflow
I used studio to create a layout with some questions. My document lifecycle state flow from "project" to "approved" to "client".
When the document is in state approved; an additional tab appears and shows a form. I have created this form layout using Studio and called it within the document screen with filters to show only when the state is "approved". If the user fills the form and submits, the state of the document changes to "Client"
The stage so far works correctly. I have been able to show the created layout in the document screen. The state of the document does change to "Client" from "Approved" when the user submits filling the forms correctly.
However the content of the form or the options chosen by the user are also to be saved. I am not quite sure how this is to be done. The data in this form is not at all similar to the document schema. I was to be able to store this data, store this transformation in history and also be able to later view what has been filled in the form.
I hope I have been to explain better this time. Thanks for your time, Anahide, and for your help.
I'm sorry but i'm not sure where your issue is since you're using custom code i'm not aware of.
Layouts can be used on other structures than documents, you just have to adapt field mappings on widget definitions.
But i don't understand where you want to persist the information filled in the form if it's not on the document, and you're saying you managed to make it work. So i'm lost and i still don't understand what's your issue…
A custom form has been defined in a studio layout. I am able to call this custom form in a custom tab in the document page. This custom form does not contain any fields that are normally available to the document and instead consists of a custom question set checklist.
e.g. of one question
- What is the % of quality of this document at "Approval"? Ans Options: Extremely good, Good, Not so good, poor.
There are about 10 questions in all.
An additional custom tab "Client" has been when the document is loaded along with the Summary, Edit, Workflow tabs…This tab is only seen when the document is in "approved" state (as I want it to be)
On Clicking the tab, I have been able to called the custom form that I made.
When the user answers the question and submits the form, I am able to change the state of the document from "approved" to "client"
The custom form layout HAS to be filled as a quality checklist form before the document state can be changed to "client"
While I am able to
- Add a new tab when the document state is "approved"
- Call the form when the tab is "clicked"
- Change the state of the document when the checklist form is submitted from "approved" to "client"
I am unable to
- Save the choice (answers) the user made when filling the form. I want these to be saved so that I can then generate a document level consolidated report on quality of approvals.
- Find a way to view this saved data -> in reference to the document by browsing the history or as a special version.
These two I want to find a solution.