Update records in Data Source with Contour programmatically
Hi everybody,
I am using contour to hook up to a data source creating records in a table (not contour). But now I would like to manipulate the records in my own table using the Contour form I also use to create the records.
I can see that it is possible to edit Contours own records i from the backend, so I tend to think that it is possible to render the Contour form programmatically with a given record and submit it programmatically, but can anybody help me with how it is done or give me some hints?
Thanks for the link. I think it is very helpful, but do you know where I can find the code, as I seem to only be able to download a package with compiled code?
var recordFieldStorage = new RecordFieldStorage(); recordFieldStorage.InsertRecordField(recordField); record.RecordFields.Add(recordField.Key, recordField);
Contour doesn't store any relation between the internal record and the record in the datasource, so making the edit work with a datasource won't be easy (if even possible)
First step would be to store a relation between the datasource and the internal record once you have that you should be able to perform an update on the datasource
Thanks a lot for your swift answers. They are very helpful :) I'lll experiment some more to see if I can make it work, and post my findings if successful. @Tim, is there a way to load the editform dynamically with my own custom data? And is there a submit event that I can subscribe to? If not would that be something that would make sense to add to Contour in the future?
Update records in Data Source with Contour programmatically
Hi everybody,
I am using contour to hook up to a data source creating records in a table (not contour). But now I would like to manipulate the records in my own table using the Contour form I also use to create the records.
I can see that it is possible to edit Contours own records i from the backend, so I tend to think that it is possible to render the Contour form programmatically with a given record and submit it programmatically, but can anybody help me with how it is done or give me some hints?
Thanks a lot in advance
Kim :)
Hi Kim,
I suggest you have a look at the rest contour package http://our.umbraco.org/projects/website-utilities/cultiv-restcontour.
The base extensions should provide you with the api calls needed.
One note though, not sure if it has been tested with an external datasource.
Hi Harald
Thanks for the link. I think it is very helpful, but do you know where I can find the code, as I seem to only be able to download a package with compiled code?
Thanks a lot in advance once again :)
Kim
Uh, crap. I thougt it came with code.
Here's some code I have for importing csv data.
Hope this helps,
Harald
Comment author was deleted
Hey Kim,
Contour doesn't store any relation between the internal record and the record in the datasource, so making the edit work with a datasource won't be easy (if even possible)
Comment author was deleted
First step would be to store a relation between the datasource and the internal record once you have that you should be able to perform an update on the datasource
Hi Guys
Thanks a lot for your swift answers. They are very helpful :) I'lll experiment some more to see if I can make it work, and post my findings if successful. @Tim, is there a way to load the editform dynamically with my own custom data? And is there a submit event that I can subscribe to? If not would that be something that would make sense to add to Contour in the future?
Once again, thanks a lot for your answers :)
Kim
is working on a reply...