“Required fields are missing” on non-null field

My organization uses a third-party relational replication tool to sync data between Salesforce and a SQL Server database. The replication software is written in Java and uses the Salesforce API for its CRUD operations. Each object, both standard and custom, is represented in the database as a table that, in addition to all object fields, contains additional fields that are used for replication purposes.

When trying to insert a record into Salesforce via MSSQL, I get this error: "Contact failed to create: Required fields are missing: [LastName]" but the LastName field is positively not empty or null. Today is the first time receiving this error on the Contact – I’ve successfully created Contact records this way in the past. To start, I’ve checked on this with the vendor and was told it has something to do with permissions of the user account under which the replication is running. I’ve checked everything I can think of related to the running user’s permissions on the Contact record, but before throwing it back at the vendor I want to make sure there isn’t anything obvious I’m missing.

Here is what I’ve checked so far:

  • Role: Admin
  • Profile: System Administrator
  • Profile has all object permissions enabled
  • Read and Edit permissions on the Name field are both set
  • Field-level security on the Name field is set to visible (read-only not selected)
  • No Contact triggers changing the value of LastName
  • No validation rules set on the LastName field
  • No workflow rules set on the LastName field
  • Confirmed I can create the identical record through the GUI under the running user

Is there anything else I should check? Is it fair to think it could be related to vendor replication code?

Answer

In short, there’s four components that determine what goes into Salesforce (assuming stable connections, no weird firewalls that strip data from messages etc).

  1. The original data
  2. The mapping of original data to SF Objects
  3. Triggers etc. in SF
  4. Access rights in SF

It seems you ruled out 1, 3 and 4 to be the problem, so there’s no other conclusion that 2 is the problem.

Check a network analyzer like WireShark to see what is actually going over the line, and try other import tools like DataLoader to check if the import still fails when you know that 2 is good. Possibly, create an Apex Trigger on the Account Object and System.debug(...) all incoming data, especially the LastName field.

Attribution
Source : Link , Question Author : Brian , Answer Author : Willem Mulder

Leave a Comment