I can successfully create entries in contour programmatically(C#) but I am
not able to update the created record using the record ID. After digging my
head around can’t find a reason why the following code doesn’t work. It’s very
basic and all That I am trying to do is get the record that exist in the contour.
RecordStorage recordStorage = new RecordStorage(); Record r = recordStorage.GetRecord(new Guid("15d654cb-a7c6-4f1f-8b55-0ecd7d19b0e3")); recordStorage.Dispose();
Just to start with the update process, I am trying to get the record object
using it’s id but can’t proceed further as it throws a weird error “An item with the
same key has already been added.” I
can’t understand while it’s trying to set the value when I call the “storage.GetRecord()”.
Following is the stack trace
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at Umbraco.Forms.Data.Storage.RecordFieldStorage.GetAllRecordFields(Record record) at Umbraco.Forms.Data.Storage.RecordStorage.GetRecord(Object id) at MauriceBlackburn.Service.ContourFormService.InsertRecord(ContourFormFields unionContourForm)
Any thoughts, have I missed something, I have been digging all day around
and still not able to figure this out. Thanks in advance.
Update Contour record using the record ID
HI,
I can successfully create entries in contour programmatically(C#) but I am not able to update the created record using the record ID. After digging my head around can’t find a reason why the following code doesn’t work. It’s very basic and all That I am trying to do is get the record that exist in the contour.
Just to start with the update process, I am trying to get the record object using it’s id but can’t proceed further as it throws a weird error “An item with the same key has already been added.” I can’t understand while it’s trying to set the value when I call the “storage.GetRecord()”. Following is the stack trace
Any thoughts, have I missed something, I have been digging all day around and still not able to figure this out. Thanks in advance.
Much Appreciated.
Comment author was deleted
Yeah that should do the trick, could it be that when creating the record you added a recordfield with the same id twice?
Comment author was deleted
Added a fix in Contour to make sure it won't try to add an item with the same key
http://issues.umbraco.org/issue/CON-364
Available in http://nightly.umbraco.org/Umbraco%20Contour/3.0.13%20WIP/
Upgrade instructions here http://our.umbraco.org/projects/umbraco-pro/contour/documentation
is working on a reply...