我创建了一个自定义Save Action
,它将WFFM字段值写入第三方服务。自定义Save Action
使用开箱即用的FieldMappings
编辑器,以便内容编辑器可以指定哪些字段映射到哪些属性发送到服务。WFFM保存动作从编辑器获取字段映射
我有它的工作,所以所有的属性出现在编辑器中供用户选择相关的字段。
的问题是,我无法找到如何在Save Action
的Execute
方法的点得到这些映射。我已经对现有的字段Save Action
进行了反编译,因为它也使用了MappingField
编辑器,但它最终会忽略映射。
public class SaveToSalesForceMarketingCloud : ISaveAction
{
public string Mapping { get; set; }
public void Execute(ID formid, AdaptedResultList fields, params object[] data)
{
FormItem formItem = Sitecore.Context.Database.GetItem(formid);
if (formItem == null)
return;
string mappingXml = Mapping;
// Using the Property Name does not return the Mapped Field
var emailAddressField = fields.GetEntryByName("Email address");
// Using the actual name of the Field on the Form returns the Field
var emailField = fields.GetEntryByName("Email");
}
}
任何人都知道如何获得映射?
当你说你不能得到映射,你是什么意思,'映射'在空执行方法是空的/空? – jammykam
嗨鉴,通过编辑器对话框创建的映射。在其他SaveActions上看到它后,我尝试添加Mapping属性,并且可以解析XML。 –