Umbraco 7.2 + Forms 4.0.1: what is new mechanism for retrieving a single record?
Documentation is light on this topic, and while I have access to recordid in TempData with 4.0.1, I don't see how to retrieve the data for a the submitted form.
Using this to obtain the formId and recordId works.
var formId = "bcc50f76-84eb-4e37-9ab2-dc9401ad6c09"; var recordId = TempData["Forms_Current_Record_id"];
This works to retrieve and review the Record data.
I've found a short-term hack which doesnt rely on simply selecting the last record returned.
Long term this could be a problem if I have 50k records and I'm iterating over every record returned.
Looking at the database in dbo.UFRecords, I was able to find a field not detailed in the documentation, UniqueId. With this I can at least match up the proper data, but again, this is not a viable permanent solution. A comment on what is "proper" or another method being exposed which returns a single record would be helpful.
string recordIdString = TempData["Forms_Current_Record_id"].ToString(); var recordIdGuid = new Guid(recordIdString); var recordSet = Library.GetRecordsFromForm(@formId); foreach (dynamic record in recordSet) { try { if (record.UniqueId == recordIdGuid) { <div> <ul> <li>Created:: @record.Created</li> <li>Form:: @record.Form</li> <li>Id:: @record.Id</li> <li>IP:: @record.IP</li> <li>MemberKey:: @record.MemberKey</li> <li>State:: @record.State</li> <li>UmbracoPageId:: @record.UmbracoPageId</li> <li>Updated:: @record.Updated</li> <li>UniqueId:: @record.UniqueId</li> </ul> </div> } } catch (Exception e) { <div style="color:red">@e.Message</div> }
Umbraco 7.2 + Forms 4.0.1: what is new mechanism for retrieving a single record?
Documentation is light on this topic, and while I have access to recordid in TempData with 4.0.1, I don't see how to retrieve the data for a the submitted form.
Using this to obtain the formId and recordId works.
This works to retrieve and review the Record data.
The Record.Id being returned is an INT and not a GUID, so how does one line up the two and retrieve the correct data?
Is there another location in memory which is storing the Record.Id?
I've found a short-term hack which doesnt rely on simply selecting the last record returned.
Long term this could be a problem if I have 50k records and I'm iterating over every record returned.
Looking at the database in dbo.UFRecords, I was able to find a field not detailed in the documentation, UniqueId. With this I can at least match up the proper data, but again, this is not a viable permanent solution. A comment on what is "proper" or another method being exposed which returns a single record would be helpful.
Hi, did you ever find a solution to this issue? I'm anticipating a lot of records so eager for a longer term solution
is working on a reply...