Is there a way to change the status (or change/create other information) stored in a form record? I am trying to display the data entered into a form in a pleasing manner for someone to review the submission and decide whether to accept or reject it. I am displaying the form data through an xslt file. Would there be a way to create "accept" and "decline" buttons on the page which could change the status of the record? Thanks for the help.
No exactly contour related but i had a similar thing. I had form created using doc2form. I had status tab with drop down on it Processed,Reject,Spam. I created an action handler that would after changing status and save would move the form into sub folder Proccessed, Spam,Reject depending on selection.
Andrew, this is fully possible - however it will require a change from xslt to some user controls.
What you can do is to leave the record just submitted, i.e. not approved. You can then use a usercontrol with an asp:repeater to list the records (you can bind to xpathnavigator) and buttons for accept/decline. In the code behind for the buttons you can open the record and approve or delete it - or modify it's contents.
I've just done this myself so please do not hesitate to ask for further details if this is unclear.
Thanks for the useful suggestions. I have created a user control and opened the form using Umbraco.Forms.Library.GetRecordsFromForm. From there, I have figured out how to diplay the form data using asp:Repeater. I am having some trouble figuring out how to modify the form data. Particularly, I would like to add a node to each record which would be named "status" which I could then manipulate (change to "accepted", "declined", "pending", etc). I'm really new to all of this and could use some hints as to what functions to call. Particularly, how do I add a new node to each record and save that to the form data? I have been looking at the Contour Developer Document, but I can't seem to find the function that I am looking for. Is there another reference that would tell me what functions are available? Thanks for your help!
You cannot really add a new node to a Contour record (unless stored as a node). If we stick to strictly contour you can either use the built-in contour status or add a custom field - with prevalues for the various states.
The field can either be a custom field type, hence hiding it from the user or you can use javascript to hide a dropdown field client side.
When you have a custom field up and running we can set a default value using a workflow. You can then update the status record field later on using your user control.
Unfortunatly there's not much documentation besides the developer document, but I'll post a member create workflow and one on creating your own records.
Thanks for your help. I think that the best way to go would be to just change the built in "state" property of a record. How do I open an individual record in my member control and change the properties?
Something in the line of this should work (written in notepad, untested).
Umbraco.Forms.Data.Storage.RecordStorage storage = new Umbraco.Forms.Data.Storage.RecordStorage(); Umbraco.Forms.Data.Storage.FormStorage formStorage = new Umbraco.Forms.Data.Storage.FormStorage();
Umbraco.Forms.Core.Record record = storage.GetRecord(new Guid(yourStringGUID)); Umbraco.Forms.Core.Form form = formStorage.GetForm(record.Form); Umbraco.Forms.Core.Services.RecordService service = new Umbraco.Forms.Core.Services.RecordService(record);
As far as I can remember you don't need service.SaveRecord unless you need to trigger a workflow, but since I'm not 100% sure I suggest you test just UpdateRecord, just SaveRecord and both to see what you need and to be on the safe side.
Change status of a form submission
Is there a way to change the status (or change/create other information) stored in a form record? I am trying to display the data entered into a form in a pleasing manner for someone to review the submission and decide whether to accept or reject it. I am displaying the form data through an xslt file. Would there be a way to create "accept" and "decline" buttons on the page which could change the status of the record? Thanks for the help.
Andrew,
No exactly contour related but i had a similar thing. I had form created using doc2form. I had status tab with drop down on it Processed,Reject,Spam. I created an action handler that would after changing status and save would move the form into sub folder Proccessed, Spam,Reject depending on selection.
Regards
Ismail
Andrew, this is fully possible - however it will require a change from xslt to some user controls.
What you can do is to leave the record just submitted, i.e. not approved. You can then use a usercontrol with an asp:repeater to list the records (you can bind to xpathnavigator) and buttons for accept/decline. In the code behind for the buttons you can open the record and approve or delete it - or modify it's contents.
I've just done this myself so please do not hesitate to ask for further details if this is unclear.
Harald :-)
Thanks for the useful suggestions. I have created a user control and opened the form using Umbraco.Forms.Library.GetRecordsFromForm. From there, I have figured out how to diplay the form data using asp:Repeater. I am having some trouble figuring out how to modify the form data. Particularly, I would like to add a node to each record which would be named "status" which I could then manipulate (change to "accepted", "declined", "pending", etc). I'm really new to all of this and could use some hints as to what functions to call. Particularly, how do I add a new node to each record and save that to the form data? I have been looking at the Contour Developer Document, but I can't seem to find the function that I am looking for. Is there another reference that would tell me what functions are available? Thanks for your help!
You cannot really add a new node to a Contour record (unless stored as a node). If we stick to strictly contour you can either use the built-in contour status or add a custom field - with prevalues for the various states.
The field can either be a custom field type, hence hiding it from the user or you can use javascript to hide a dropdown field client side.
When you have a custom field up and running we can set a default value using a workflow. You can then update the status record field later on using your user control.
Unfortunatly there's not much documentation besides the developer document, but I'll post a member create workflow and one on creating your own records.
Hi Harald,
Thanks for your help. I think that the best way to go would be to just change the built in "state" property of a record. How do I open an individual record in my member control and change the properties?
Thanks,
Andrew
Does anyone know how to open a record (if you know the record id string) and change the state? Thanks for your help.
Something in the line of this should work (written in notepad, untested).
As far as I can remember you don't need service.SaveRecord unless you need to trigger a workflow, but since I'm not 100% sure I suggest you test just UpdateRecord, just SaveRecord and both to see what you need and to be on the safe side.
is working on a reply...