Sunday, 27 March 2011

Getting a BCS Column related field name

Whilst some people might go through the process of using an XML parsing to get the RelatedField static name for a BCS Column(typically to set it e.g.) :


SPField tagField = oItem.Fields["Account"];                             

XmlDocument xml = new XmlDocument();

xml.LoadXml(tagField.SchemaXml);

String sEntityName2 = xml.FirstChild.Attributes["RelatedFieldWssStaticName"].Value;

I think a more quicker and efficient way is to do the following :


tagField.RelatedField.ToString();

No comments:

Post a Comment