SP2010 Client Object Model: How to cast Field to FieldCalculated

Hello,
I need to modify formula for existing field and can't do it because this code raise exception - (Cannot cast 'fld' (which has an actual type of 'Microsoft.SharePoint.Client.Field') to 'Microsoft.SharePoint.Client.FieldCalculated').
using (var clientContext = new ClientContext(@"http://Server"))
{
var web = clientContext.Web;
var lst = web.Lists.GetByTitle("MyList");
<strong>var fld = (FieldCalculated)lst.Fields.GetByInternalNameOrTitle("Formula1");</strong>
clientContext.Load(fld);
clientContext.ExecuteQuery();
}
I can't use fld.SchemaXml modification by some reason.
May be you can help me?
Thank you.

More Related Resource Links

Hi,
I am using Client Object Model to get all items from a list and display theme with "Modified By" information. Everything works nice until I start using test users. I have noticed that for user who is in Domain Admins group i have no problem for others I
cannot read "modiefied by" field value.
var context = ClientContext.Current;
activitySPList = context.Site.RootWeb.Lists.GetByTitle("Activities")
activityItems = activitySPList.GetItems(CamlQuery.CreateAllItemsQuery());
context.Load(activityItems);
context.ExecuteQueryAsync( ClientRequestSucceeded, ClientRequestFailed );
All items in activityItems collection doesn't have "Modified By" fields. Do you know why and how to fix it?
Thanks for your help.

I am working on the project that is based on Client Object Model which should be able to create/update document sets form client side with possibility to fully manage column values. I've managed so far to manipulate from client most of field values but i'm
still struggling with managed metadata fields. I know that there isn't any support for this type of field in CSOM so I used TaxonomyClientService which is available from server side and managed to retrieve data necessary for displaying field info. I also discovered
that value for this field should be assigned in string form like [WssId]#[TermName]|[TermGUID] to be valid. My problem is how to retrieve WssId. I know it can be found in TaxonomyHiddenList of site collection but since it contains only values that were used
in site collection so far it doesn't represent full solution for my problem. Any help would be appreciated.

I am having an issue when trying to add a field to the web.AvailableFields. I am using web.AvailableFields.AddFieldAsXml(...) but it seem
that you need to associate the field with a list. Is it not possible to add a field to the site collection columns using the client object model?

What I am doing is creating a content type and then adding fields to this content type, if the fields dont exist I what to create them but an having a problem doing so.

I cant seem to locate EventRecievers in the Client Object Model
I was expecting since you can modify UserCustomActions you would be able to modify List/Site SPEventReceiverDefinitions through the new awesome Client Object Model?

Just wanted to create a utility to easily modify/list Event Recievers attached to a Sites Lists without a server context.

I have a problem assinging External column value to ListItem object with client object model-based application I'm developing. To be precise, I am able to retrieve data related to external content type by reading external list created from this content type
but I don't know how to properly use it to assign value to this field. By doing some research on my own I concluded that BDC ID column from external list is the way to go since it uniquely defines selected row from external list but that doesn't
tell me much since I don't know what to do with it. Currently I ended up with partial solution - to assign plain string value of picker column but that makes this value visible only in "View Properties" option on Sharepoint and not in "Edit Properties"
which pritty much makes sence since it isn't properly related to rest of the data in specific row. Does someone have a better solution for this?

I was wondering if there's a way to properly get the field value for the AssignedTo field? All I'm getting back is Microsoft.SharePoint.Client.FieldUserValue. I understand there's an id associated with each user in the site collection and that
it looks it up. I just thought the COM would've taken care of it.

In SharePoint 2010 there are a number of object models that can be used by developers to access the server. For example, the Client Object Model (Client OM) can be accessed via Web services, via a client (JavaScript) API, and via REST. (Length: 12:22)

Sorry for my bad english.
With WPF, I can get authentication using below code
ClientContext clientContext = new ClientContext("URL");
clientContext.AuthenticationMode = ClientAuthenticationMode.Default;
NetworkCredential credential = new NetworkCredential("ID", "PASSWORD", "URL");
clientContext.Credentials = credential;
But with silverlight, I can't find AuthenticationMode property with ClientContext.
I want to get authentication using client object model with silverlight.
Can anybody help me?
thanks!!