locked
SP2010 Client Object Model: Fields on Edit Form? RRS feed

  • Question

  • I'm building a Windows Forms application to allow users to fiddle with SharePoint documents from their desktop.  I need to be able replicate the Edit form for a particular content type, but can't find information on getting the fields displayed via the client object model.  I can get all the fields associated with a content type and the various properties of those fields, but obviously I don't want to show every single field from a content type to my users.  The server object model can accomplish this via the SPField.ShowInEditForm property, but no similar properties exist on the client side.

    I think I could get this information by embedding a WCF service in SharePoint, but I'd like to avoid doing that if it all possible.

    Advice?


    • Edited by TruckStuff Monday, February 13, 2012 10:28 PM
    Monday, February 13, 2012 10:28 PM

Answers

  • I stumbled upon the answer to anyone else looking to solve a similar problem.  While the client object model doesn't specifically expose properties for ShowInEditForm or ShowInNewForm as the server object model does, I've found that the SchemaXML property of the Field object does contain this data.  Granted, you have to parse the XML to get the data, but it is there.
    • Marked as answer by TruckStuff Thursday, February 16, 2012 9:46 PM
    • Edited by TruckStuff Thursday, February 16, 2012 9:47 PM
    Thursday, February 16, 2012 9:46 PM

All replies

  • The client object model doesnt expose this property.

    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.field_properties.aspx

    WCF service wrapper would possibly be your safest best.  


    Varun Malhotra
    =================
    If my post solves your problem could you mark the post as Answered or Vote As Helpful if my post has been helpful for you.

    • Proposed as answer by Jeffrey Zeeman Tuesday, February 14, 2012 12:01 AM
    Monday, February 13, 2012 11:59 PM
  • I stumbled upon the answer to anyone else looking to solve a similar problem.  While the client object model doesn't specifically expose properties for ShowInEditForm or ShowInNewForm as the server object model does, I've found that the SchemaXML property of the Field object does contain this data.  Granted, you have to parse the XML to get the data, but it is there.
    • Marked as answer by TruckStuff Thursday, February 16, 2012 9:46 PM
    • Edited by TruckStuff Thursday, February 16, 2012 9:47 PM
    Thursday, February 16, 2012 9:46 PM