.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

ListData.svc fails if list has calculated column with Yes/No (boolean) return type

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :SharePoint

I have a list with a calculated column whose return type is Yes/No.  If I try to browse to the list or a list item using REST via ListData.svc, I get the error "An error occurred while processing this request".  Can't seem to find anything in 14\LOGS or the System or Application event logs.  I've tried multiple calculation formulas such as:



Both display "Yes" when viewing through the SharePoint UI and are sortable and filterable.  If I change the calculated column return type to anything else (single line of text, currency, date/time, etc.) and update the formula as necessary, ListData.svc displays the list item XML as expected.  If I replace the calculated column with a regular column whose type is Yes/No, ListData.svc displays the list item XML as expected.

Is this a known bug?  Is there a workaround (other than manually casting to bool in my code)?

View Complete Post

More Related Resource Links

using [content type] in calculated column

I want to get the content type in the calculated column. [content type] is available in Moss not able to use that in 2010. Any idea?

Set a Calculated column as hidden in a content type

Hello, I'm building a custom list with several columns, including a Calculated column. This calculated column simply takes the value of a choice column in the same list to convert this value to a single line of text value. I do this because when adding a lookup column to this list, I cannot select Choice columns as additional columns, but I can add the calculated column. Speaks for itself that this calculated column only needs to exist in the background, and end users should not see this column in the Add/Edit/Display forms. In add/edit forms the column is not displayed, but in the display form it gets displayed. Piece of cake I thought, I'll just set it as hidden in the content type used for the list. When I open the column the column settings (required/optional/hidden) is grayed out, so I cannot set it to hidden. In SP2007 this was possible, why can't I do this anymore in SP2010? Do I miss some feature in order to do this, or is there a good reason why this seems to have changed in SP2010?

Calculated column and hyperlink field type

Hi I have customer who is asking me if this is possible to provide filter based on the HyperLink field, where he could easly limit results to only those items where link field is filled. As filtering on hyperlink column type is not supported I was thinking to buld some calculated field based on it to return YES (if link is provided) or NO (if link is not provided). The problem is that hyperlink field type is not avialiable on the list of field to be used on calculated field. is there some workaround for that ? thanks for help   Mariusz Gorzoch Blog : http://mariusz.gorzoch.pl Twitter : http://twitter.com/MariuszGorzoch Facebook: http://www.facebook.com/mariusz.gorzoch

Custom user selection in Person or Group type column as per other list.

I have two list in the Sahrepoint Foundation 2010 site. 1) Projects with Title and members(Person or Group - multiple selection) 2) Tasks (Team site default)  - added lookup column Projects form the first list (required) Now I want to assign task given users in the projects list. ex. I have users A,B,C,D,E and Two Project P1 and P2 I have defined that P1 project has users A,B,C so task is distributed/assigned between this members, not to D and E I need some validation or lookup which restrict selection or D and E.   Thank you.  

Remove Column from List Content Type


I have a list that inherits from 2 site content type.  When I added the "site content types" to my list it created a "copy" of it in my "List Content Type". 

Then I created a new column directly into my list, and at the bottom of the column creation screen there is a checkbox saying "Add to all content types" that was checked by mistake (I dont want the List Content types to have the column).

Now, is there a way I can remove those columns from the "List Content Type"? 

I saw that I can delete the "List content type" and re-link to the "Site content type", but I would need to delete all of my items before doing that, and I want to avoid that.



.net 2010 REST WCF - json does not return the root List type



I am using the .net 2010 WCF Rest Service Application template to create my services.

The service needs to support two return format - xml and json which 2010 easily handles by changing the Accept value in the header info.

I have the following class structure

   public class ri
        public string nm { get; set; }

        public string nval { get; set; }

        public string cnt { get; set; }

    public class r
        public string val { get; set; }

        public string nm { get; set; }

        public List<ri> ri { get; set; }

   public class refinements
        public List<r> refs { get; set; }

   public class GetRefinementsSvc
        [WebGet(UriTemplate = "")]
        public refinements GetCollection

Issue with People and Groups type of column in datasheet view of shrepoint list.


We have a list created in MOSS 2007 which has a column of type people and groups. When we open the list in datasheet view and try to add records for people and groups type of column the column shows only records from All People section of the site collection. I have verified this for another site collection within the same web application where I am able to see all the users though they are not in the All people section of site collection.
Could anyone please let me know if I am missing any setting or if there is any change required to see all the user names in the people and groups type of column in datasheet view.

Thanks ,

How to add a auto genterated column in a sharepoint list of type number in SharePoint 2010


am try to generate a auto increment column for my SharePoint list of type number type?

=TEXT(1000+ID,0) , when i use this formula it works some time and some time it doesn`t increment?


do you know any out of box way to do this?

Thanks in Advance

Share Knowledge and Spread Love!

Mandatory description field on a 'hyperlink or picture' column type on a list?


I've been given the task of making the 'description' field of a url column for a list on one of our sharepoint sites, mandatory.

The problem is that the field is already set as mandatory in the list template (deployed as a feature), although this only makes the web address / url portion of the 'new item' page a mandatory input. The box below this ('Type the description') remains a non mandatory field.

Is it possible to make this field mandatory as well? I would have to do this at a feature (schema.xml) level if so.


Programatically adding the "SummaryLinks" type column to the Site columns list



Can anyone help me with the sample code to programatically add the "SummaryLinks" type column to the Site columns list.



Custom list -- control issue with column type "Choice" and Infopath 2010

I finally got our project lead to abandon external SQL lists, so now I've created custom lists in SP 2010. I have some columns that are of "Choice" type/"Display as radio buttons" (customer requirement). When I start Infopath 2010 locally and create the data connections to the list(s), those choice fields display in I/P as dropdowns. If I change the control with a right-click to "Option Button", I only get one -- I need 2 (yes, no) or, in a few upcoming cases 3 or 4. BTW, same with changing the control to a check box -- only get 1. FWIW, I get the same results if I start Infopath directly from the list in SP Designer 2010. Any ideas?
Joel W. Johnson

Calculated column based on other columns in Lookup list selection


.. if that makes any sense.

I have a list with with lookup column to another list. that list has other columns.

I want to add a calculated column on the parent list, that set it's value to column from another list, but based on my selection in the lookup column of the parent.

Possible? presuming the calculated column  gets set when I submit and not interactively? what if edit the data and change my selection?


Bug: Does not change column type from nvarchar to ntext


Scenario: If you create a table with a column of type nvarchar, populate it with some content and try to modify it using the WebMatrix editor, from nvarchar to ntext, it does not display any error message or warning that this is not possible. It silently saves and reverts the change, back to nvarchar. Wasted some hours on this issue as I thought my column was ntext, but in fact was still nvarchar.

Expected behavior: It should change to ntext, or if SQL CE doesn't support that, it should notify the user that no change was applied.

Need Syntax To Make Results of LINQ Union Return Non-Generic Type



I have the below SQL which works just fine:

SELECT     Message, CreateDate, AccountId, AlertTypeId
FROM       dbo.Alerts
SELECT     TOP (100) PERCENT Status, CreateDate, AccountId,
                          (SELECT     10 AS Expr1) AS AlertTypeId
FROM         dbo.StatusUpdates
WHERE AccountId = PassedInParameter

I have been going about trying to convert the above into a LINQ method and am having problems with return types.
As the above SQL illustrates, I am querying two distinct LINQ tables - Alerts and StatusUpdates -
and then attempting to perform a Union on them. In order to do the union in LINQ, I have to have agreeing types. So, I
am using "var" to make the results of "alerts" and "updates" generic before the union.  

public IList GetStatusUpdatesAsAlertsByAccountId<T>(Int32 accountId)
            using (WorkbookDataContext dc = _conn.GetCont

Picker returns nothing for BDC column in custom list


Playing with the BDC for the first time, running into some issues adding a Business Data column to a custom list.

I believe my ADF file is solid. I've been able to import that just fine and can use the application to drive various BDC-specific webparts (a Business Data List or Business Data Item, for example). It also seems to work when I manually enter information in my NewForm.aspx field and click the Check Names button (it verifies my entry and underlines it, creates link to profile when I view the list data).


If I try to use the picker, I get nothing. Enter a name I know is valid or a % and click the magnifying glass icon and I very briefly get the "Please Wait" message, then just an empty set with "Type into the search box above then press "Enter" to start your search" where my results should be.

Any pointers? Thanks.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend