I have a SharePoint list containing multiple fields of mileage data and one calculated field to total all of the miles. I programmatically add new number fields as necessary and need to modify the calculated field to include the newly added number field. I've tried the following code to reference the calculated field but receive an error that the field does not exist (I have confirmed the field name is correct):
SPFieldCalculatedtotalMiles = hikingList.Fields.GetFieldByInternalName("Miles Earned")asSPFieldCalculated;
Any ideas on what I am missing?
Thanks.
Eric