I've a weird problem using razor script in Umbraco 4.11.7 with Contour 3.0.5.0.
See following code:
var form = new DynamicForm(formId);
var cRecords = form.Records.Items.Where(x => x.State == Umbraco.Forms.Core.Enums.FormState.Approved);
foreach (dynamic record in cRecords)
{
var check = record.HasField("Comment");
}
No matter what value I pass to HasField, it always returns true, even if it doesn't exist nor has exist before. If I do the following check after the previous one:
record.GetField("Comment") != null
Obviously it will throw error if it doesn't exist.
Razor Record.HasField() always return true
Hi,
I've a weird problem using razor script in Umbraco 4.11.7 with Contour 3.0.5.0.
See following code:
No matter what value I pass to HasField, it always returns true, even if it doesn't exist nor has exist before. If I do the following check after the previous one:
Obviously it will throw error if it doesn't exist.
Anyone else has this problem?
Thanks for reading.
is working on a reply...