1

Resolved

createLookupColumn throws an exception if the Field definition's DisplayName attribute is different from Name

description

createLookupColumn throws an exception if the Field definition's DisplayName attribute is different from Name.
 
// AddFieldAsXml returns the field Name
string sCreatedColName = web.Fields.AddFieldAsXml(sColumnDefinitionXml);
 
// web.Fields expects the DisplayName
lookupColumn = web.Fields[sCreatedColName];
 
// This should do the trick
lookupColumn = web.Fields.GetFieldByInternalName(sCreatedColName) as SPFieldLookup

comments

chrisobrien wrote Sep 12, 2007 at 9:41 AM

Fixed in 1.0.0.1

wrote Sep 12, 2007 at 9:42 AM

wrote Feb 13, 2013 at 6:30 PM

wrote May 15, 2013 at 11:43 PM

wrote May 15, 2013 at 11:43 PM

wrote Jun 12, 2013 at 1:03 AM