I'm trying to find metadata about the length of fields in MS Dynamics CRM 4.0 - does anyone know if/where this information is available from the metadata services? I tried looking on the AttributeMetadata class, but can't find anything there. Yet, the field length does show up in MS's metadata browser, so it must be accessible somehow.
2
votes
2 Answers
3
votes
1
votes
Thanx @Matt worked like a charm. I used it as below:
StringAttributeMetadata stringAttributeMetadata = (StringAttributeMetadata)attributeMetadata;
recordToBeUpdated[recordFieldLogicalName] = recordFieldValue.Length < stringAttributeMetadata.MaxLength.Value ? recordFieldValue : recordFieldValue.Substring(0,stringAttributeMetadata.MaxLength.Value - 1);