When the Countour form is submitted, (containing the submitter email and some fields), I will send an email containing a verification link (containing the recordId) that points back to my site.
Does anyone have an razor example of how to update an field (IsVerified) in a record by it's recordId?
Might be better to set it to manual approve and then when it has been vericated set the state to approved (you don't need to have the isVerified field then)
if (!string.IsNullOrWhiteSpace(recordId)) { try { var guid = new Guid(recordId); using (var storage = new RecordStorage()) { var record = storage.GetRecord(guid); var form = new FormStorage().GetFormFromRecordId(record.Id); var service = new RecordService(record); var verifiedRecordField = record.GetRecordField("Verified"); verifiedRecordField.Values.Clear(); verifiedRecordField.Values.Add("1");
Verify post by email
Hi!
When the Countour form is submitted, (containing the submitter email and some fields), I will send an email containing a verification link (containing the recordId) that points back to my site.
Does anyone have an razor example of how to update an field (IsVerified) in a record by it's recordId?
/Jonas
Comment author was deleted
Might be better to set it to manual approve and then when it has been vericated set the state to approved (you don't need to have the isVerified field then)
Will see if I can find an example of that
Yes, I will use the manual approve also, but I would like to verify the submitters email adress by sending an verification link.
/Jonas
Solved!
var recordId = Request["post"];
if (!string.IsNullOrWhiteSpace(recordId))
{
try
{
var guid = new Guid(recordId);
using (var storage = new RecordStorage())
{
var record = storage.GetRecord(guid);
var form = new FormStorage().GetFormFromRecordId(record.Id);
var service = new RecordService(record);
var verifiedRecordField = record.GetRecordField("Verified");
verifiedRecordField.Values.Clear();
verifiedRecordField.Values.Add("1");
storage.UpdateRecord(record,form);
storage.UpdateRecordXml(record,form);
@Verified()
}
}
catch(Exception ex)
{
@Error();
}
}
is working on a reply...