Yesterday, I saw a question posted into
Sitecore Community form related to "Add Contact to Contact List" WFFM save action.
The issue was, when "Add the contact to a contact list" save action was used in a WFFM form.
when the user submits the form, he receives following error message in the page.
We experienced a technical difficulty while processing your request. Your data may not have been correctly saved.
And when checked in the error logs, we can see following error message
11668 09:38:20 WARN Null ids are not allowed.
Parameter name: userName
Exception: System.ArgumentNullException
Message: Null ids are not allowed.
Parameter name: userName
Source: Sitecore.Kernel
at Sitecore.Security.Accounts.User.FromName(String userName, Boolean isAuthenticated)
at Sitecore.Form.Submit.AddContactToContactList.Execute(ID formid, AdaptedResultList fields, Object[] data)
at Sitecore.Form.Core.Submit.SubmitActionManager.ExecuteSaving(ID formID, ControlResult[] list, ActionDefinition[] actions, Boolean simpleAdapt, ID sessionID)
11668 09:38:20 WARN The 'Add Contact to Contact List[id={C5E1D916-2476-4BE4-AE90-7B419B55C9E1}]' save action failed: We experienced a technical difficulty while processing your request. Your data may not have been correctly saved.
11668 09:38:20 WARN Web Forms for Marketers: an exception: We experienced a technical difficulty while processing your request. Your data may not have been correctly saved. has occured while trying to execute an action.
Then, I tried to add "Create User" save action into the WFFM form Save actions as shown below
And then when try to fill the form and submit it, it worked. :-)
Reason for this is, to add a user into a Contact List using "Add contact to Contact List", he should be already created in Sitecore as a user.
Update : User is now added into Contact List
Will dig deep into code how and why this happens in a later blog post.
Happy Sitecore :-)