In my project I am creating custom column of the 'Multiline' type.

 destList.Fields.AddFieldAsXml(_fieldXml, true, 
 _context.ExecuteQuery(); //Successfully created new column

This is xml field vlaue added while creating new field.

<Field AppendOnly="FALSE" Description="Description of the Team" DisplayName="TDescription" IsolateStyles="TRUE" NumLines="10" RichText="TRUE" RichTextMode="FullHtml" Title="TDescription" Type="Note" ID="{20c5bd33-4261-4e6c-80c7-9560c40bf1d7}" SourceID="{e3b57731-6c3d-473a-8593-5fb8c306ce3e}" StaticName="TDescription" Name="TDescription" ColName="ntext2" RowOrdinal="0" />

But when I try to access the same field to insert its value, list field collection don't have newly created field.

    ViewFieldCollection f_Viewfield = null;
   // Selecting fields which are visible inthe list
   f_Viewfield = destList.DefaultView.ViewFields;

foreach (var _field in _fieldCollection)
  ///// If column is visible in the list select it
   string result = null;
   result = f_Viewfield.Where(x => x == _field.EntityPropertyName ||
           x == _field.InternalName).FirstOrDefault();
   if (result != null)
    Console.WriteLine(_field.Title+" >> "+ _field.InternalName);

Please suggest the solution.

  • Can any one please suggest the solution for this issue? – Mayuresh Apr 17 '18 at 8:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.