Skip to content

Instantly share code, notes, and snippets.

@tomfulton
Created April 25, 2012 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomfulton/2493234 to your computer and use it in GitHub Desktop.
Save tomfulton/2493234 to your computer and use it in GitHub Desktop.
Umbraco Contour - Manually approve a record
// Record Storage
Umbraco.Forms.Data.Storage.RecordStorage rs = new Umbraco.Forms.Data.Storage.RecordStorage();
Guid formGuidGuid = new Guid("<your form GUID here>");
// Get the record
Umbraco.Forms.Core.Record record = rs.GetRecord(formGuidGuid);
// RecordService
Umbraco.Forms.Core.Services.RecordService s = new Umbraco.Forms.Core.Services.RecordService(record);
// Approve
if (s != null)
{
if (s.Record.State != Umbraco.Forms.Core.Enums.FormState.Approved)
{
s.Approve();
}
}
s.Dispose();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment