WCF based External List Columns Type in Sharepoint 2010

In my Sharepoint 2010 I've created External List that uses WCF service as data source. This is my data type that is exposed by the service:
[DataContract]
public class Item
[DataMember]
public Guid Id { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public string Description { get; set; }
Everything is fine as long as I'm using simple types such as string, int, bool. This types are mapped to Sharepoint types without any issue.
Now I what to use something more complex.
[DataContract]
public class Item
[DataMember]
public Guid Id { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public string Description { get; set; }
[DataMember]
public Uri Link { get; set; }
I've added Link property of type Uri. By default this field does not appear in my list at all because, as far as I understand, sharepoint doesn't know how to map this property. I would like to map it to field of type Hyperlink or Picture.
Is there any way to explicitly define to which type I want my property to be mapped to? I can use another type in my Item class if necessary.

a URI and a SPHyperLink wouldn't directly match up... a SPHyperLink contains a URI and a description.
BCS has a bit of trouble when it comes to complex types... your best bet is to stick with the supported primitives, and then convert to a hyperlink on the rendering side (custom list view, search results web part, etc).
see: http://stackoverflow.com/questions/5399340/sharepoint-bcs-creating-a-hyperlink-column
Scott Brickey
MCTS, MCPD, MCITP
www.sbrickey.com
Strategic Data Systems - for all your SharePoint needs

Similar Messages

  • Dyanamic form generation based on list columns

    Hello all ,
    How can i create a Sharepoint webpart for List form which is dyanamically create controls based on Selected field in view ...
    Suppose I am having one Sharepoint list ... In that there are 4 columns ...
    A -- as text box , B - Dropdown , C - Choice , D- richtexbox
    and View I have selected only field A,B,D
    Now the in webpart form should be render only with selected control in List view..

    Hi,
    According to your description, you want to create controls dynamically based on the selected view fields.
    You can get the view fields type using SPView.ViewFields Object. Then you can create the control based on the field type.
    More information about SPView Object for your reference:
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spview.viewfields.ASPX
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/0eb6bf19-e112-432f-87a9-719c8447c66c/get-all-columns-properties-of-the-particular-view-in-the-sharepoint-list?forum=sharepointdevelopmentprevious
    More information about how to create form control dynamically:
    http://zieglers.wordpress.com/2010/04/08/dynamically-creating-form-controls-in-sharepoint/
    As another workaround, you can hide the control which is not in list view in New/Edit form using JavaScript:
    http://www.sharepointdiary.com/2012/12/hide-columns-in-newform-editform-dispforms.html
    Best regards
    Patrick Liang
    TechNet Community Support

  • Validation on external content type in sharepoint 2010

    Hi,
    I have created one external content type.
    Table which used by this content type contain primary key.
    SO whenever i created a record with same id, its giving me following error:
    Please help to solve the issue.

    Hi,
    The following materials would be helpful:
    Tutorial: Access Salesforce Leads in SharePoint through an External List
    http://geekswithblogs.net/dataintegration/archive/2014/02/03/tutorial-access-salesforce-leads-in-sharepoint-through-an-external-list.aspx
    Salesforce SharePoint Integration – Best Practices
    http://rainforce.walkme.com/salesforce-sharepoint-integration-best-practices/#.VFxra3mKAeE
    If you want to upload documents to SharePoint document library from the Saleforce, we can also customize your own web service using SharePont .Net Client Object Model or REST to achieve it.
    Best Regards 
    Dennis Guo
    TechNet Community Support

  • How to take list backup with lookup columns data in sharepoint 2010

    Hi friends,
    I have one issue on "Copy the list in one sitecollection to another sitecollection"
    I have one list like "ABC" and with lookup column "Status" this column is looked to anthor list columns
    My task is i want to Copy the same list with lookup columns with Data(lookup columns Data) in one site and restored in another site.
    Error  is Lookup columns Data is not coming.
    How to Copied list with lookup columns data to restored in another list?
    Badri

    i think there is no such method to move the list with lookup column. 
    couple of things which cause the failure, Number Source list may be not available on the target site collection, Column IDs / List IDs different from Site collection a to B.
    I would try to use the backup of site collection and restore it, i am not sure whether it will work not.
    i think copy the data from the lookup clomn in the excel, then move the list to different site collection with blank data then copy the data from excel to new list.
    check this one for another idea:
    http://blog.johnsworkshop.net/moving-lists-with-lookup-columns-inside-your-site-collection/
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • List and libraries in sharepoint 2010 content database

    I want to know when I create List or form library . where every form of form library will go.
    Will it save into content database ?
    I want to make report from the content database for form library or list ?

    All Content in SharePoint is stored in the content database and there are APIs that you can use to access the contents of a particular list or library in SharePoint.  But if you are thinking that you can access a specific list as a single table or portion
    of a database table in the content database for your report then you will be disappointed for two reasons.
    First, direct access to the SQL databases in SharePoint is prohibited by your license agreement.  It is too easy to break things in SharePoint when you start accessing the databases directly.
    Second, individual entries in a list or library are not stored directly in one place.  
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • How to make a SharePoint list column ReadOnly using Sharepoint designer

    Hi,
             I am new to sharepoint. Need to make a few columns readonly in a sharepoint list.  Not sure how. Any help is appreciated.
    Thanks

    Here is one more Simple and Best practice to be fallowed using powershell
    http://soreddymanjunath.blogspot.in/2014/04/readonly-field-using-powershell.html
    Cls
    Add-PSSnapin "Microsoft.Sharepoint.Powershell"
    $web= Get-SPWeb -Identity "http://test.dev/sites/Wftest"
    $ls=$web.Lists.TryGetList("test");
    $flds=$ls.Fields["CustID"]
    $flds.ReadOnlyField=$true
    $flds.Update();
    Note:  If
    ReadOnlyField =TRUE,
    the field is not displayed in New or Edit forms 
    ReadOnly to TRUE hides
    the field from Site Settings pages for managing site columns and content types. Setting the Hidden attribute
    to TRUE completely
    hides the field from the UI. 
    Default  ReadOnlyField value
    is set to false.
    Best Practice is to Use 
    $flds.ShowInDisplayForm=$false;
    $flds.ShowInEditForm=$false;

  • Date column validation in sharepoint 2010 lists (without designer)

    Hi,
    I have a list with a date column which i want to validate against the current date at the item's creation time. When i insert a formula in the validation field, i always get errors. For example, i've tried this:
    [column name]>TODAY
    How can i get this to work? Sharepoint designer is disabled and i can't use it.
    Thanks and regards,
    Juan

    Try using
    =[Column Name] > NOW()
    Edit: Or better yet...
    =[Column Name] > TODAY()
    Bob Guidinger

  • View containing custom column works in SharePoint 2010 but crashes webpart in SharePoint 2013

    First off.. I am using SP FOUNDATION.  Secondly, I'm linking a contact library from a parent site to a view on a sub site. This works in SP 2010 but when I tried to duplicate it in our new SP 2013 site, it doesn't.
    Reproduce steps to add Parent Contact Picks to Blog Sub-Site in SP 2010 (Foundation)
    In parent site, create a contact list (add some people)
    In parent site à Site Settings
    à Site Columns … create a new Column of type “Lookup”. 
    Set the Information Source to the Contact List in step 1 with its Column = “Last Name (linked to item)” 
    Create a BLOG sub site
    BlogSite à Site Settings
    à Site Libraries and Lists
    à Posts
    à Add from existing site columns …. Select the Lookup column you created in step 2.
    BlogSite à Site Settings
    à Site Libraries and Lists
    à Posts
    à Create View à Standard View….Create a new view and select ONLY the lookup column from step 4.
    Add a new Blog post and while in the ‘New-Item’ form, make sure to select a person from the Contact list.
    Open up the details page of the new post so that only the single post shows. Edit the Page and Insert a New Web Part
    à Lists and Libraries
    à Posts.
    Edit the newly added web part and change its view to the one created above in step 5.
    Drop the down arrow to the right of the newly added web part’s title and select Connections
    à Get Filtered values From
    à Post [1] (or whatever the default Post Web part is called). Set both the “Provider” and the “Consumer” field names to “ID”.
    You will now see that whenever you open the “Details” page of any blog post, you will see the Main post (aka the original form), the normal “Add Comment” entry web part, AND 
    the new web part that show the Contact selection specific to that single post. Clicking on the Name of the contact will actually pop up the details from the parent site.
    SharePoint 2013 (Foundation)
    Now perform the exact same steps in SharePoint 2013. However you’ll notice that Step 8 above appears to work but as soon as you try and edit that web part again or move on to step 9, the newly added web part states “Unable to display this Web Part. To troubleshoot
    the problem….. Correlation ID: 52d36c9c-e7a2-509e-1d60-3df1ce53ce2d”.
    Followup: In doing some testing I determined the following..
    1 - If I adjust step #5 as to NOT select the new linked column.. it works. Oddly however, the new view works when are you just using the view by itself (/site/lists/Posts/NewViewname.aspx).
    2 - I can fix the crash by enabling the 'Server Render' option on the WebPart. This actually now shows my information however the linked field is no longer a link.
    3 - As long as it's not a Lookup type column, I can follow the same process and do not need the Server Render option. Of course these other types are not live links.
    Seems like a bug to me.

    I set "Breakline" hidden because I don't want to show this in create new item form. 
    I realized that may be the reason. So changed the column to Optional in CT and created a new calendar using that CT. then at list level CT I changed it to Hidden.  That works.   The column is available for use when modifying view.
    Thanks

  • Out of the box workflow of type Approval - SharePoint 2010 not recording approver comments

    When I am implement my approval workflow, two new fields are created - Approval Status and Approver Comments.
    The Approval Status field gets a value of either Rejected, Pending, or Approved.
    The Approver Comments is not getting any value, even though I am entering comments in the popup approve workflow task and those comments are appearing in the emails sent.
    Why do the comments not show up in the item's Approver Comments column?

    Hi,
    With
    SPWorkflowAssociation.AssociationData property, we can get the assignees’ information. Your script can
    be able to retrieve a XML format data which contains the user name we need:
    So the next step would be getting the user name by parsing the XML data we got.
    The two links below will show how to parse XML with PowerShell:
    http://stackoverflow.com/questions/18032147/parsing-xml-using-powershell
    http://blogs.technet.com/b/heyscriptingguy/archive/2012/03/26/use-powershell-to-parse-an-xml-file-and-sort-the-data.aspx
    With the user name, we can get the
    Email property of an user with the scripts as the link below provided:
    http://davidlozzi.com/2012/03/07/using-powershell-to-access-sharepoint-sites/  
    Best regards
    Patrick Liang
    TechNet Community Support

  • Sharepoint Foundation Can not update External List by Work Flow

    Hi
    I try to update External List by other list Work Flow, in Sharepoint 2010 Foundation.
    Here is the manual: 
    http://msdn.microsoft.com/en-us/library/office/ff394479(v=office.14).aspx
    But it fails , and the error message is “The
    workflow could not update the item in the external data source. Make sure the user has permissions to access the external data source and update items.”
    Is there some limited in Foundation?

    http://social.technet.microsoft.com/Forums/en-US/0bb9ef28-3614-4db2-b19f-dd81e8cc2d42/the-workflow-could-not-update-the-item-in-the-external-data-source?forum=sharepointgeneralprevious
    With no Secure Store in Sharepoint what we ended up doing was creating a new external content type, adding a new connection and picking a connection type of .net type instead of sql.  This means we needed to create a .net app as the go between but within
    .net we had all the usual tools for connecting to sql without permission issues.
    Also check
    http://wyldesharepoint.blogspot.in/2010/06/setting-up-external-content-type-for.html
    If this helped you resolve your issue, please mark it Answered

  • How can I change the width of a column in a list of sharepoint 2010 ?

    How do I change the column width in sharepoint 2010 so the data displays properly in standard view?
    I open the list View in sharepoint designer,and change the width of the <td> ,but ,when I preview ,the column width don't change. what should I do?

    While they may auto adjust to what it thinks is a correct width, far too often it allocates way too much room and that causes lists with 4 columns to be much longer than they need to be and without the ability to adjust them, lists look strange.
    http://twitpic.com/23ro09/full is an example of the first column having been allocated too much room.
    Denzel

  • Deleting sharepoint list content type Fields

    Hi
    Please tell me the code for deleting all the fields inside content type fields..This is my code i used,but its not deleting the fields.
     SPSite spsite = new SPSite("http://ghfjhhk18:8001");
                SPWeb web = spsite.OpenWeb();
                web.AllowUnsafeUpdates = true;
                SPList list = web.Lists["Test"];
                SPContentTypeCollection cts = list.ContentTypes;
                SPContentType ct = cts["Item"];
               // ct.FieldLinks.Delete("Expires");
                //ct.Update();
                SPFieldCollection contentTypeFieldCollection = ct.Fields;
                foreach (SPField spField in contentTypeFieldCollection)
                    if (ct.Fields.ContainsField(spField.Title))
                        //SPFieldLink fieldLink = new SPFieldLink(spField);
                        ct.FieldLinks.Delete(spField.Title);
                    //myContentType = null;
                ct.Update();
                web.AllowUnsafeUpdates = false;
            }but this code is not deleting the fields..
    pls help me as soon as possible.
    One friend told me to do for loop in reverse..but how can i accomplish that

    Hi,
    Please refer the below code snippet which may help you to fix your issue. If not please refer the below links also
    http://ptsharepoint2010.blogspot.in/2011/12/programmatically-remove-fields-from.html
    http://www.c-sharpcorner.com/uploadfile/54db21/delete-field-content-type-in-sharepoint-2010-programmaticall/
    using (SPWeb web = site.OpenWeb())
    SPList spList = web.Lists["<ListName>"];
    SPContentTypeCollection spCTS = spList.ContentTypes;
    SPContentType spCT = spCTS["YourContentType"];
    spCT.FieldLinks.Delete("YourField");
    spCT.Update();
    If its not helping you, please let us know
    Sekar - Our life is short, so help others to grow
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
    you see a reply being an answer to the question of the thread, click "Mark As Answer

  • Can data fetched into External List be refreshed

    I plan to create an External List via BCS in SharePoint Designer 2010. Original Data resides in SQL tables. Can the data in external list be automatically refreshed when the data changes in SQL? If yes, is there a setting for
    it?

    Hi
    Please check the link
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/e781b173-c0b7-4dd9-9a2a-9162d202e668/refresh-external-list?forum=sharepointgeneralprevious
    http://aanuwizard.com/2012/04/14/sharepoint-2010-auto-refreshing-external-data-lookup-column/
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Send a list item as a bulk e-mail using SharePoint 2010

    My scenario is to e-mail newsletters to a group of users (running into 1000's) and we were thinking about any pro's and cons of using SharePoint here.
    Preferable if the newsletter were embedded in the e-mail so there is no need to give permission to a user to visit the site (or do we have to anyway?)
    Also, a functionality such that, every list item could have an option such as "E-mail to Group 1" or "Email to Group 2" that would allow the item to be mass e-mailed.
    Group 1 assume to be a group of 500 individuals with only e-mail addresses known...
    If SharePoint seems right, then can anyone suggest me how to go about this? If it is possible with OOTB/designer?

    For you scenario, you could explore ECB Menu action using SharePoint designer.
    The logic would be first fire up SharePoint designer and create an ECB menu to start a workflow ie initiate workflow in SharePoint designer (you need to create two workflows each for Group1 and Group2 to make it simple)
    Next step would be to create a workflow to send an email to the selected group and use item values within the workflow to create the newletter.
    here are some reference on how to -
    http://sharepointyankee.com/2009/12/19/adding-custom-actions-to-the-list-item-menu-in-sharepoint-2010-using-sharepoint-designer-2010/
    http://blog-sharepoint.blogspot.com/2011/10/tutorial-add-custom-list-actions-using.html
    http://office.microsoft.com/en-us/sharepoint-designer-help/send-e-mail-in-a-workflow-HA010239042.aspx
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

  • Where can I get the latest Microsoft.SharePoint.ApplicationPages.dll for SharePoint 2010?

    Can somebody point me to where I can get the latest Microsoft.SharePoint.ApplicationPages.dll for SharePoint 2010?
    When I go into Library Settings on any library or list in SharePoint 2010 I’m getting an unexpected error; I see this in the SharePoint log:
    11/18/2014 13:12:26.36 w3wp.exe (0x2260)                       0x33EC  SharePoint Foundation        
            Runtime                                      
    tkau       Unexpected       System.NullReferenceException: Object reference not set to an instance of an object.    at Microsoft.SharePoint.ApplicationPages.ListEditPage.SetSectionLinks()    
    at Microsoft.SharePoint.ApplicationPages.ListEditPage.OnLoad(EventArgs e)     at ASP._layouts_listedit_aspx.OnLoad(EventArgs e)     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 03c7c5b4-407f-461c-9cf7-0304eb797b1a
    I searched online and found this:
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/ed5aa58a-f5cc-4449-8bfd-65ca6f101641/list-settings-page-error-on-all-type-of-sharepoint-2010-listslibraries?forum=sharepointgeneralprevious.  It says:
    We noticed exactly the same issue after applying some SharePoint updates (SP1 + October 2011 CU).  The problem turned out to be that there was an older version (V14.0.4762.1000) of Microsoft.SharePoint.ApplicationPages.dll in the GAC. 
    This version was being loaded instead of the latest version of the DLL (14.0.6112.5000).
    Loading the latest version of Microsoft.SharePoint.ApplicationPages.dll fixed the problem with the List/Library settings page.
    I check our Microsoft.SharePoint.ApplicationPages.dll and found that we have version 14.0.6024.1000.
    I would like to try replacing it with the latest version to see if that could fix the problem going into library settings.
    Does someone know where I can get the latest Microsoft.SharePoint.ApplicationPages.dll for SharePoint 2010?
    David

    You would need to extract it from an update. Pre-SP2 SharePoint 2010 is no longer supported, I'd recommend upgrading to SP2 which should take care of any versioning issues.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

Maybe you are looking for

  • Airport extreme can not be recognized?, Airport extreme can not be recognized?, Airport extreme can not be recognized?

    My Airport Extreme Station (4th Generation) is all of a sudden not recogized by the Airport Utility Software. I rebooted the Airport Extreme device a few times, disconnected it completely, and did it set it back to the factory default setting. No rec

  • Can't open a thing! Why does CS4 suddenly started crashing upon starting?

    Opening either the program (and I've tried it with Illustrator, Photoshop, InDesign and Acrobat), or the file itself (if I'm lucky enough to have the CS4 program open fine with startup but then when I click to open a file it closes unexpectedly), jus

  • How do I get the old search toolbar back?

    Yesterday, I'm assuming Firefox updated without asking or telling me, and now the way that my search toolbar functions is totally different. I don't like it. I want to be able to use the old search bar, where you can click the arrow by the magnifying

  • SQL QUERY TO REMOVE ONE OF THE THE RESULT SET

    Hello Everyone, I need some advise on how to achieve the subject. My query is as follows: select t2.post_date a, trunc(sysdate - (&num + 1)) from trans_hist t2 where t2.post_date >= trunc(sysdate - (&num + 1)) and 'xxxxxxxxxxxxxxx' in (t2.reference_f

  • Purchasing Info. Record (urgent)

    Hi, I would like to ask the use of purchasing info. record. I had maintained 2 condition records in Purchasing Info. record(ME12): i) 01/01/08 - 31/01/08    => $2 ii) 01/02/08 - 31/12/9999 => $1.8 There is a PO: 45XXXXXXXX with 10pcs consignement sto