.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

Problem with Content Query Webpart and Custom Userfields

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :SharePoint
Dear Community, I am using Sharepoint 2007's content query webpart to access content types from 2 lists each contained in a different sitecollection. To achieve this, I used this tutorial: http://www.heathersolomon.com/blog/articles/CustomItemStyle.aspx. The tutorial worked great. By using the property CommonViewFields and modifing the XML Stylesheets accordingly, i could access almost every field. Even User Fieldtypes like editor and author were accessible by adding (editor,User) or (author,User) to the CommonViewFields property. But when I tried to access the custom made userfield "Username" in the same way (adding Username,User to the property), the webpart threw an error and couldn't be displayed anymore. When I changed it to Username,Text , no error occured but it naturally didn't show up, since it is the wrong fieldtype. I hope some of you can help me, since all my researches on this topic only brought up some more people with the same problem, but no solution to it. Thanks in advance, SoundofSilence

View Complete Post

More Related Resource Links

Sharepoint Content query Webpart

hello all ,             i want to create a webpart, which should display HTML code. and i need to edit the HTML source code.. how can i do it in sharepoint and which project i need to choose to create this webpart

Dynamically Setting the property value FilterValue1 of the Content Query WebPart? Inline? codeblock?

I want to dynamically set the FilterValue1 property of a Content by Query to the querystring ID. I tried to do it with an inline embed FilterValue1="<%= Reponse.Write .. but no luck Without having to code my own webpart, any way to change the value with a small C# code block? How about with javascript? Thank you!    

Problem with Update of Sharepoint Taxonomy Fields in custom developed Content Types

Dear all, we developed an solution on sharepoint 2010 for one of our customers with custom lists and content types with fields from the managed meta data store. As recommended we developed everything in features & solutions so that easy deployment is possible. Adding metadata to the termstore seems to work without problems, but today we stepped over an confusing issue: Our customer changed the default label of an term in the metadata term store, but the label did not change in listviews and detailviews of items in the specific sitecollection. In editview we see the correct label. After searching a while we discovered the connection between the sitecollection and the term store, the hidden Taxonomylist (/Lists/TaxonomyHiddenList/AllItems.aspx) in the sitecollection, which seems to map the terms. After testing we discovered that the term/label did also not change in the hidden taxonomy list. The Timerjob “Taxonomy Update Scheduler“ is running hourly with success and we also tried to start the job manually, but the label did not change in the hidden list. Also there are no errors in the logfiles in verbose mode. We also tested to create a managed metadata field manually, put it in a list and after that, changed the label. For whatever reason the update of labels on manually created fields works without a problem. Our lists, content types etc get created pr

Custom Webpart not working on "My Profile" page but works on all other pages. Linq Problem?

Hi, I created a publication site and in that site i created pages with specifique metadata (using a pagelayout with a custom content type)0. My webpart is getting data from those pages and displaying it. My webpart works on every page except on the "my profile" page(overview tab). I get the following error: Invalid Url: /TestSites/course I used the SPMETAL to create a class and i'm using this class to retrieve the data from the pages (with linq). The url i give to the entity is http://pcp/TestSites/course  this works fine on every site except on the my profile page. Can anybody help me? Here is the code i use to retrieve my data: EntitiesDataContext ctx = new EntitiesDataContext(courseSite); //Code below gets only the pages with a courses contentType. //EXCEPTION TRIGGERT ON THE FOLLOWING LINE IF IN PROFILE PAGE EntityList<Courses> course = ctx.GetList<Courses>("Pages"); //Writing the query to get the correct pages(with the course page layout only! var Query = from myCourse in course.ToList() where myCourse.CourseParticipants.Contains(myWeb.CurrentUser.LoginName) Select new{myTitle = myCourse.CourseTitle, myCompany = myCourse.Company, myPath = myCourse.Path, myName = myCourse.Name }; Thx.    

Content Query webpart


I have created contnet by query  webpart  to diplay the results 5 per page

How to write the xsl code in sharepoint 2010 for content by querywebpart
explain step bystep.
I want to display the  5 itesm perpage.
Like this
in first page the 5 results should diplay
in seconpage the next 5 results should diplay.

Content Query webpart paging


I have created contnet by query  webpart  to diplay the results 5 per page

How to write the xsl code in sharepoint 2010 for content by querywebpart
explain step bystep.
I want to display the  5 itesm perpage.
Like this
in first page the 5 results should diplay
in seconpage the next 5 results should diplay.

Content Query Webpart to show edit item link field in SPS2010


I have a Content Query Webpart in SharePoint 2010 that I would like to surface Documents grouped by content type. I wish to show the edit form or view Properties link as part of the fields shown in the results. When the User clicks on this link, it should take him to the edit form or view Properties page for the document.

Any ideas?

Problem while creating task with custom content type in sharepoint workflow


Hi all,

I am trying to create task with custom content type in sharepoint statemachine workflow. But it is showing "Error Occured" after task creation code is excecuted. can anyone tell me what is the problem.

Task Content type


  <ContentType  ID="0x01080100A707C0079E8547c0A87515457DB90629"
      Description="Workflow Task"
      <FieldRef ID="{9da97a8a-1da5-4a77-98d3-4bc10456e700}" Name="MyComments" DisplayName="MyComments"  />
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
        <FormUrls xmlns="

Content Query Webpart Missing Content Type and Approval Status


I'm a great fan o the CQWP , and love the changes made in 2010 on this webpart. What bothers me is that I use to Filter Documents by Approval Status, thus showing Draft or Pending Documents and Group these by their Content Type.

Both these were available in 2007, but removed from 2010 CQWP. Any idea why, or how to bring this back? sample or URL guidance would be great. My gut feeling is custom XSLT but id like to confirm this first.

Thx a lot



Content Query WebPart (CQWP) not showing thumbnails of the rollup image



I have set up my CQWP to display pages from a newssite. This is working fine, but my rollup images is showing in full size. As I have understood, SharePoint has the ability to scale down pictures and showing them as thumnails.

In the "Fields to display:" I have set the path to "Thumbnail; Rollup Image; ".

Content Query Webpart + Managed Metadata + Public facing site


I have content query webparts to fetch data based on filter on managed metada its work like charm but not working on Public facing site.

i mean on public facing site its not showing data.i check all pages in library are published and also all css and custom .xsl file also published.

please advise me

Thanks Ron

Content query webpart - presence icon not getting displayed



The ContentQueryMain.xsl has a template "CallPresenceStatusIconTemplate" for displaying the presence icon (Microsoft communicator presence) which is called from the ItemStyle.xsl template. The ContentQueryMain displays it based on the SipAddress. Though the SipAddress is updated in user profile store, presence icon is not getting displayed. Sip format is "sip:domain\username"

I tried printing all the fields that are available to CQWP using the below code

<xsl:for-each select="@*">
    P:<xsl:value-of select="name()" />

But in the field list I don't see SipAddress. I tried adding a site column SipAddress to the list that I'm binding, even then it doesn't get displayed in the field list.

Any suggestion is appreciated



Content Query WebPart shows page items with status "draft", and page items that current user does no



I have this issue that CQWP is rendring items that it should not render. I test this with a read-only user, that should NOT see draft pages or pages with different permissions. But the read-only user do see the items, but when I click on the link I get access denied. This access denied is correct, but why does the page items appear in the CQWP at all?


1) I use OOTB CQWP (inherits from ContentByQueryWebPart in my .webpart file) : "<type name="Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart ....." and I have my custom xsl to get the look and feel I need

2) The issue with page items showing when status = drafts only appear when using the PublishingExpirationDate field. When I try creating new pages and give them status draft by using "check in to share draft" (logged on as an contributer/approver user), this item wil NOT appear in the CQWP for the read-only user. When I change a pages' status from approved to draft, this item will still be shown in the CQWP, but this will point correctly to the published version. But after the pages' expired date (PublishingExpirationDate) is expired, the page gets status "draft" (handeled by a timer job I guess), and this page item will still be rendered in the CQWP, but sending the read-only user to an access-

NullReferenceException when using Content Query webpart with BCS List




I have a BCS List in my SP 2010 solution, which works fine. Now I want to add the Content Query web part that sources its data from this external list. In the Content Query web part properties, when I select my External list in the "Show items from the following list" field, I get this exception:

[NullReferenceException: Object reference not set to an instance of an object.]
  Microsoft.SharePoint.Publishing.WebControls.ContentByQueryToolPart.OnPreRender(EventArgs e) +216
  System.Web.UI.Control.PreRenderRecursiveInternal() +107
  System.Web.UI.Control.PreRenderRecursiveInternal() +223
  System.Web.UI.Control.PreRenderRecursiveInternal() +223
  System.Web.UI.Control.PreRenderRecursiveInternal() +223
  System.Web.UI.Control.PreRenderRecursiveInternal() +223
  System.Web.UI.Control.PreRenderRecursiveInternal() +223
  System.Web.UI.Control.PreRenderRecursiveInternal() +223
  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3393

Is it even possible to do this? Or is there another way? Thanks in advance!

Strange behaviour taxonomy filter in content query webpart on anonymous website


We are experiencing strange behaviour on a publishing facing website implemented in SharePoint 2010.

The story
We use a (default) Content Query Webpart to show related information in relation with the current page. The filter is using a field value (UserFieldValue) of the current page and filters other pages which have the same tags. The fields, on the current page and the related pages, are taxonomy field. Everything works fine!

We published the pages, looked at the website as an anonymous user and everything was still going smoothly. We went home, slepts an hour of 6, waked up. Proudly checked our beatifull new website :). Ahhhhh, what is this.. all content query webpart with the filters on the taxonomy field returned exactly nil.

We logged in to our website, checked if the pages where published, and well, they are... Just published them again. And everything looked fine again.... but not for long. Exactly the next day (... app pool recycle ...) the same problem ...

Logged in again to our website, logged out...  problem solved.... till the next apppool recycle.

My conclusion
Until the firrst authenticated visit to the page the taxonomy filter on the content query webpart silenty fails.

As a "temporary" workarround we have created a sc

Content Query WebPart

I have exactly followed the MSDN article below.

(Displaying Custom Fields in Content Query Web Parts in Office SharePoint Server 2007)

The only difference i have is that : when i view the Field Names of my columns in the content type they are as follows :





But I am surprised to see that my Project Details does not appear inspite of providing them in the CommonViewFields property of 

by .webpart file. I have made sure that there are no extra spaces between the fileds mentioned.

But when i try the same for a field WITHOUT SPACES , it works fine

<property name="CommonViewFields" type="string">ProjLocation,Text;Project%5Fx0020%5FOwner,Text</property>

In my style sheet , i have added the code 

Content query web part problem


Hi, i am trying to prevent a content query webpart from displaying subfolders of folders... let me illustrate: i have a document list that i want to present in a content query, and in this list i have several folders that also, in turn, contain both other folders (lets call them "subfolders") and documents. When i select content type to display to be folders, what the content query does is it lists top level folders and "subfolders" as well, which is something that i want to avoid. How can i go about this? I know that i could filter out the "subfolders" by specifying each and every one by name in the filters, but that just doesn't seem right, so is there another solution or workaround for a situation like this (or is there something trivial that i'm not seeing)?

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