Avatar of xyxlor

asked on 

Accessing added SharePoint List Columns in C#

I have been asked to make modifications of an existing website using SharePoint. The task is to add a Yes/No option to a list, and have the value retrieved via a website.

I have modified the list in SharePoint but whenever I try to access the column in C# it returns null.

Basically, I have copied all references for a similar column coming from the same list and modified it to suit the column.

This was done for all references, so i dont understand why this doesnt work right off hand... Do I need to tell sharepoint to refresh something? or restart a service?

/** This is returning null ? **/
if (currentNode.Attributes["ows_Contacted_x0020_About_x0020_ZipCode"] != null)
	a.ContactedAboutZipCode = Conversion.GetBoolean(currentNode.Attributes["ows_Contacted_x0020_About_x0020_ZipCode"].Value);
/** This is the code I referenced **/
if (currentNode.Attributes["ows_ABF_x0020_Contract_x0020_Signed"] != null)
	a.ABFContractSigned = Conversion.GetBoolean(currentNode.Attributes["ows_ABF_x0020_Contract_x0020_Signed"].Value);

Open in new window

Microsoft Server AppsMicrosoft SharePoint

Avatar of undefined
Last Comment

8/22/2022 - Mon