- Wednesday, September 26,200 7 pmSteve Curran mvpknowledgelake (partner, MVP)
29,755 points 0
Sign in to vote
Change your type to URL
<Value type = 'url'> http: // moss12/Client1 </value>
- Thursday, September 27,200 AMPritam dahake
90 points 0
Sign in to vote
In the 2nd caml code snippet I have, I did try with value type of 'url'... but it doesnt return any results ..
Can you confirm that you are able to use URL field in your caml query?
Thanks
- Thursday, September 27,200 7 AMSteve Curran mvpknowledgelake (partner, MVP)
29,755 points 0
Sign in to voteyes
- Thursday, September 27,200 pmPritam dahake
90 points 0
Sign in to vote
Smc750,
Below is the code snippet I am actually using in my application and it is not returning any results back.
The "sites" list has a column of Type hyperlink called "url" with internal name as "siteurl ". the list has right now two items in it, with URLs http: // moss12/Client1 and http: // moss12/Client2. using this query I was expecting to get both the items back.
Do you see anything wrong with the code here? I have tried using fieldref name = 'url' as well as fieldref name = "siteurl'... both dont return any results back !!!
Spweb = spcontext. Current. Web;
String squery = "<where> <beginswith> <fieldref name = 'url'/> <value type = 'url'> HTTP: // moss12/client </value> </beginswith> </where> ";
String slist = "sites ";
Splist = spweb. Lists [slist];
Spquery query = new spquery ();
Query. query = squery;
Splistitemcollection items = splist. getitems (query );
- Thursday, September 27,200 pmSteve Curran mvpknowledgelake (partner, MVP)
29,755 points 0
Sign in to votenothing wrong here. cocould be security. check to make sure the user executing query has read rights to the items in question.
- Thursday, September 27,200 pmPritam dahake
90 points 0
Sign in to vote
The code is in development running on my machine...
I am the machine admin... the SharePoint service is running under my account... so there is no security issue here...
- Friday, October 05,200 pmRobert L. bogue [MVP] Thor projects LLC (partner, MVP)
25 points 0
Sign in to vote
The problem is likely that moss12 is the name of your Sharepoint Server. sharePoint strips the server name for relative URLs before storing them in the DB so when caml does the query it needs to be just the relative path.
- Tuesday, October 09,200 pmDan keelingslalom Consulting (partner)
1,530 points 0
Sign in to vote
Download and use the u2u tool, you can get test data back from an order by query, and then see in plain text what the values of the URL field look like. then change as needed. link is here
- Monday, October 22,200 pmKjapsbufdir
20 points 0
Sign in to vote
Did you find a solution to this issue? I have the exact same problem. I have used the caml Query Builder (u2u) to examine the URL field, and it looks like this
Http: // server/myweb, http: // server/myweb
This is driving me nuts.
- Monday, October 22,200 7 pmSteve Curran mvpknowledgelake (partner, MVP)
29,755 points 0
Sign in to vote
This whole issue cocould be related to a Microsoft Bug in the spquery and spquerysitedataquery classes. you can find out more here. this bug is not due to be fixed until SP2. I have seen no results come back for this reason reset times.
Http://www.sharepointblogs.com/smc750/archive/2007/07/24/spsitedataquery-limited-to-10-document-libraries-or-lists.aspx
- Friday, January 04,200 pmM. blumenthalmagenic (partner)
30 points 2
Sign in to vote
I recently needed to see if an URL was in an splist, And what I ended up doing was this:
- Create a string variable to hold the tail end of the url I am looking. so if I am looking forhttp: // server/managedpath/spweborsitecollectionname, I wocould put "/managedpath/spweborsitecollectionname" in the urltail string variable.
- Do my spquery to match against the urltail instead of the URL, my caml wowould look like this:
<Where>
<Beginswith>
<Fieldref name = 'url'/>
<Value type = 'url'>/managedpath/spweborsitecollectionname </value>
</Beginswith>
</Where>
3. When I get my results back, convert each one to a string and see if it contains the full URL (http: // server/managedpath/spweborsitecollectionname ).
Hope that helps!
-- M. Blumenthal