We have setup a custom attribute called Toll Free that we use to track 800 numbers.
In trying to setup a relationship map between the Lead and Account entity, I received the well known error:
“This attribute map is invalid. The selected attributes should be of the same type. The length of the target attribute should be equal to or greater than the length of the source attribute and the formats should match. The target attribute should not be used in another mapping.”
In looking, I noticed that we have the attribute set to a max of 25 characters in the lead and the default 100 characters in the account. Oh, well there’s the problem. I edited the attribute in the Account and shortened it. Problem solved, right?
Nope, same error. After checking all the other relationships to make sure it wasn’t used elsewhere, I was about to tear out some hair. Then I stumbled on Ronald Lemmen’s article about the error. His article didn’t solve the problem, but in the comments, someone had the solution.
When an attribute is created, a second database field called MaxLengthCRMAttribute set to 2x the value of the length of the attribute. Here’s the key, when you shrink the length, it doesn’t shrink the max length. However, when you increase the length, it does.
So I edited the Lead attribute that had been created, set it to 100, published then set it back to 25 and published again. After that, I was able to add the relationship because the max length field values now matched.