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
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Print only the user Created fields in Sharepoint using JavaScript
Gowtham Rajamanickam
Apr 20
2015
Code
1.1
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
<script>
$(document).ready(function{
var listTitle=
"TestList"
;
var viewname=
"Myview"
;
retrieveFieldsOfListView(listTitle,viewName);
});
function retrieveFieldsOfListView(listTitle,viewName){
var context =
new
SP.ClientContext.get_current();
var web = context.get_web();
var list = web.get_lists().getByTitle(listTitle);
var listFields = list.get_fields();
context.load(listFields);
context.executeQueryAsync(printFieldNames,onError);
function printFieldNames() {
var e = listFields.getEnumerator();
while
(e.moveNext()) {
var field = e.get_current();
var schema = field.get_schemaXml();
if
(/SourceID="http/i.test(schema)){
alert(
"custom field found:"
+ field.get_title());
}
}
function onError(sender,args)
{
alert(args.get_message());
}
}
</script>
User Created fields in Sharepoint
Print user created field