Any time I create two fields that are both marked as Do Not Map To Salesforce, including Markup fields or Fieldsets which could not logically map to anything, I get the error: "The field key 0 is already in use by the field labeled XXXXX. Please use a unique key." Is there any way around this?

Comments

obsidiandesign’s picture

Do you get the error when saving the field or when trying to submit the Webform?

jgrr’s picture

When saving the field.

obsidiandesign’s picture

Assigned: Unassigned » obsidiandesign

Interesting - the error seems to be coming from Webform itself, so I'll have to look into how to handle the form key differently to keep the error from coming up. What version of Webform are you using?

jgrr’s picture

We've got Webform 7.x-3.18. My theory is that the SalesforceWebform module is mapping the picklist item "Do Not Map To Salesforce" to the name '0,' which works fine the first time, but then the second unmapped field tries to use the same name, and it throws an error.

I wonder if it would work to turn off mapping while building the form, then turn on the Salesforce mapping and create mappings only for fields that need them. But I think the module tries to automap field names when possible, so that could give odd results.

obsidiandesign’s picture

That would be a temporary workaround; I'm working on a change that will re-set the standard form key if you select "Do not Map". I think the reason it hadn't come up in testing before is that when I test the module, it's by setting up the form, then mapping after, as you described.

obsidiandesign’s picture

Status: Active » Fixed

A fix for this has been pushed to the 7.x-1.0 branch but will need to be ported. Basically, the fix re-sets the field key based on the field name (via _webform_safe_name) when the user selects that a field should not be mapped to Salesforce that was previously mapped.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.