TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
goran ljubic
NA
27
3k
what's wrong with query
Apr 25 2018 2:05 PM
i have a event receiver that after changing item document in document library it changes item value in another list. i created the 4 spquery's on same document library and 4 splistitem collections i need items count for every spquery. i have problem with the first spquery every time i receive count=0 but i have documents on this location (5 documents). my code for spsuery and splistcollection is next
SPQuery fajloviviewAD100 =
new
SPQuery();
fajloviviewAD100.Query =
"<Where><And><Contains><FieldRef Name='FileRef'/><Value Type='Text'>A?/100</Value></Contains><Eq><FieldRef Name='FSObjType'/><Value Type='Text'>0</Value></Eq></And></Where>"
;
fajloviviewAD100.ViewAttributes =
"Scope='RecursiveAll'"
;
SPListItemCollection fajloviAD1000 = properties.List.GetItems(fajloviviewAD100);
SPQuery fajlovi2 =
new
SPQuery();
fajlovi2.Query =
"<Where><And><Contains><FieldRef Name='FileRef'/><Value Type='Text'>???/500</Value></Contains><Eq><FieldRef Name='FSObjType'/><Value Type='Text'>0</Value></Eq></And></Where>"
;
fajlovi2.ViewAttributes =
"Scope='RecursiveAll'"
;
SPListItemCollection fajloviSIK500 = properties.List.GetItems(fajlovi2);
SPQuery fajlovi3 =
new
SPQuery();
fajlovi3.Query =
"<Where><And><Contains><FieldRef Name='FileRef'/><Value Type='Text'>???/600</Value></Contains><Eq><FieldRef Name='FSObjType'/><Value Type='Text'>0</Value></Eq></And></Where>"
;
fajlovi3.ViewAttributes =
"Scope='RecursiveAll'"
;
SPListItemCollection fajloviSIK600 = properties.List.GetItems(fajlovi3);
SPQuery fajlovi4 =
new
SPQuery();
fajlovi4.Query =
"<Where><And><Contains><FieldRef Name='FileRef'/><Value Type='Text'>??/700</Value></Contains><Eq><FieldRef Name='FSObjType'/><Value Type='Text'>0</Value></Eq></And></Where>"
;
fajlovi4.ViewAttributes =
"Scope='RecursiveAll'"
;
SPListItemCollection fajloviAD700 = properties.List.GetItems(fajlovi4);
fajloviAD100.Count.ToString()
fajloviSIK500.Count.ToString();
fajloviSIK600.Count.ToString();
fajloviAD700.Count.ToString();
fajloviSIK500.Count, fajloviSIK600.count and fajloviAD700.count back values but fajloviAD100.count back 0
why? where i made mistake
Reply
Answers (
2
)
Sharepoint Online- Creating a footer
Restapi to update choice field with new vvalues dynamically