User uploads data through a form, a custom workflow fires and redirects the user to a page with the record's uniqueId as a url param. On this page I want to display some of the data from the form record - how do I do this?
I can't seem to find anything in the documentation that allows me to access a record directly from the unique ID.
In Umbraco 7 we could use the RecordStorage to do this
If anyone has the same issue as I did:
I managed to work around this by doing a dependency injection in a surface controller:
public class SubscriberSurfaceController : SurfaceController
{
private IRecordStorage _recordStorage;
private IFormStorage _formStorage;
private Guid formGuid = new Guid("Form GUID here");
public SubscriberSurfaceController(IRecordStorage recordStorage, IFormStorage formStorage)
{
_recordStorage = recordStorage;
_formStorage = formStorage;
}
public void GetRecordData(string recordId)
{
Form form = _formStorage.GetForm(formGuid);
Record record = _recordStorage.GetRecordByUniqueId(new Guid(recordId), form);
//Do stuff with record here
}
}
Accessing record data in Razor view
Use case:
User uploads data through a form, a custom workflow fires and redirects the user to a page with the record's uniqueId as a url param. On this page I want to display some of the data from the form record - how do I do this? I can't seem to find anything in the documentation that allows me to access a record directly from the unique ID.
In Umbraco 7 we could use the RecordStorage to do this
If anyone has the same issue as I did: I managed to work around this by doing a dependency injection in a surface controller:
public class SubscriberSurfaceController : SurfaceController {
is working on a reply...