We have a small custom online application form that brings a user through a number of steps collecting user information. Each of these steps is a separate webform which is tied to a single Saleforce object (a Lead). The Drupal username of the applicant is being mapped as the key field on each form.

The first step successfully creates the Lead in Salesforce, and the data is being pulled in correctly. When step 2 is submitted an error will be thrown saying the value is incorrect for one of the fields that has not been dealt with in either step. If this field is hardcoded, another error will be thrown on the next field and so on.

I suspect that the update call is sending in all of the fields on the object, and not just the ones that have been mapped on the current form. If I remove the key field in step 2 a new object is created, so it doesn't appear to be a mapping error.

Is this a legitimate bug, or is mapping multiple forms to a single object not supported?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RemyAroundTown created an issue. See original summary.

dbcollies’s picture

I've not tried doing what you're describing, so it will take some investigation.

A couple questions:

  • Can you give details about the fields throwing the error? Is there anything special about them, as far as you know? Things like:
    • Required field
    • Createable but not updateable
    • Validation rules which might be causing a conflict
  • The system should support multi-step forms. Does that meet your requirements, or do the forms have to be independent?
RemyAroundTown’s picture

  • The fields throwing errors all seem to be booleans for which a value has not been set. If a hard-code a value for the field throwing the error it simply moves on to the next one.
  • An example would be 'email opt-out', which is not required and can be set correctly if I hard-code it on the first form.
  • Validation rules are correctly preventing the submission to salesforce. I'm only seeing these errors once the form is valid.

A multi-step form would meet the base requirements for our application, but we were hoping to capture lead data at every step to allow for follow-ups on abandoned applications that meet certain criteria.

For the time being we are going to create an endpoint to surface submission data and import to salesforce from there. My hope is that someone else experiencing this error in the future will at least find this post as a jumping off point, as I could find nothing on this specific error.

dbcollies’s picture

Status: Active » Needs review

I believe the attached patch should resolve the issue. The problem was that fields were being sent to Salesforce even if no value was specified in the web form. So, you were correct is guessing that multiple updates from separate forms was not supported, although there was no technical reason for it.

Thanks for the report. If this patch fixes the problem for you, then it will be included in the next release.

dbcollies’s picture

  • dbcollies committed 5851ccf on 7.x-1.x
    Issue #2790725 by dbcollies: Filtered out unused fields on record update...
dbcollies’s picture

Status: Needs review » Fixed

I've gone ahead and pushed this patch to DEV, and the bug is pretty big, and I don't see how it could have any negative impacts. All it's doing is rolling back an unintentional change that came in with an earlier feature addition.

dbcollies’s picture

A new version (1.3) has been pushed out, primarily to get this bug fixed in production.

RemyAroundTown’s picture

Confirming that our issue was cleared up in the new version. Thanks so much!

dbcollies’s picture

Glad to hear it! Thanks for bringing this to my attention, so it could be fixed.

Status: Fixed » Closed (fixed)

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