Learning SharePoint   Enhance Your SharePoint Knowledge

Subscribe to Learning SharePoint Subscribe
Twitter Learning SharePointFollow Us
in Learning SharePoint
Check Out Our New SharePoint 2013 series!

How to get various item fields using Client Object Model Ecmascript – SharePoint 2010

07/06/2011  
Category: SharePoint 2010


Here is a list of Fields\Field Types that you would need while accessing SP.ListItem using ECMASCRIPT\JavaScript.

Field  – How to Get\set it

Title – SP.ListItem.get_item(‘Title‘);

ID – SP.ListItem.get_id();

Url -SP.ListItem.get_item(‘urlfieldname‘).get_url()

Description – SP.ListItem.get_item(‘descriptionfieldname‘).get_description();

Current Version – SP.ListItem.get_item(“_UIVersionString“);

Lookup field – SP.ListItem.get_item(‘LookupFieldName’).get_lookupValue();

Choice Field – SP.ListItem.get_item(‘ChoiceFieldName‘);

Created Date – SP.ListItem.get_item(“Created“);

Modified Date – SP.ListItem.get_item(“Modified“); -> case sensitive does not work with ‘modified’

Created By – SP.ListItem.get_item(“Author“).get_lookupValue());

Modified by – SP.ListItem.get_item(“Editor“).get_lookupValue());

File  – SP.ListItem.get_file();

File Versions -  File.get_versions();.

Content Type – SP.ListItem.get_contentType();

Parent List – SP.ListItem.get_parentList();

Subscribe to Learning SharePoint Subscribe
Twitter Learning SharePointFollow Us
in Learning SharePoint
Advertisement

Random Posts

Programatically add users to a group Client object model SharePoint 2010
Programatically add users to»

In this post I am sharing a short Code Snippet for creating and adding a User in a existing group»

Access denied when creating New Crawl schedule in SharePoint
Access denied when creating»

After creating a new SSP and while creating new content source when i tried to Create a New Crawl Schedule»

Assign users Permission to a list item in workflow sharepoint 2010
Assign users Permission to»

Code behind will assign “Full access” and “Design” permissions for a given list item to users XXY and XXZ (we»

Recent Forum Posts

Linq to Sharepoint

by RS on May 18, 2012

comments on the code

by spbsmile on May 18, 2012

connection(add) EditControlBlock and my program

by spbsmile on May 18, 2012

Custom master pages used in multiple SharePoint 2010 sites

by ubersteve on May 18, 2012

upload file and click on button but cant upload file into list by using below code

by santhoshreddy on May 18, 2012