I'm working on a custom field type for WFFM forms that records a cookie. Our save action uses the ControlResult
's FieldType
property to know when it's a field of this type and do some extra logic on it. The property is added during the control's GetResult
method, which looks like this:
public override ControlResult GetResult()
{
ControlResult result = new ControlResult(this.FieldItemId, this.Name, (object) this.Value, this.ResultParameters, false)
{
FieldType = FieldType
};
return result;
}
We have a custom save action (CustomSendEmail
, which implements ISaveAction
) that reads the control results as an AdaptedResultList
in its Execute
method:
public void Execute(ID formId, AdaptedResultList adaptedFields, ActionCallContext actionCallContext = null, params object[] data)
When I try to debug I observe two things:
- My custom
GetResult
methods runs as expected, and I can observe theFieldType
property set on the result before it returns. - By the beginning of the
Execute
method, the control result still exists but theFieldType
is nownull
.
What step am I missing for my FieldType
to survive into the save action?
Relevant details:
- Sitecore 8.1 update 3
- WFFM version consistent with Sitecore version
- Glass Mapper and Castle Windsor (although I don't think they affect anything here)