Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7177705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:46:11+00:00 2026-05-28T16:46:11+00:00

I have a list in SharePoint 2010 with some columns. All are default types.

  • 0

I have a list in SharePoint 2010 with some columns. All are default types. So I have
“Single line of text”
“Multiple line of text”
“Date and Time”
“Choice”
“Number”
“Currency”
“Person or Group”

My aim is to have a custom ribbon tab or group where I can perform some action on this list. As a starting point I created an Empty Element in my Visual Studio solution and put inside Elements.xml my buttons. This works so far. I also figured out how to do a postback to react on pressed button. This postback refers to a JavaScript file.

Before performing some action I tried first to read the given contents and return them using alert('first field: ' + field1). In first called function I have

function calledPostbackFunction(string button) {  
    var context = SP.ClientContext.get_current();  
    this.site = context.get_site();  
    this.web = context.get_web();  
    context.load(this.site);  
    context.load(this.web);  
    context.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceded(button), Function.createDelegate(this, this.onQueryFailed));

How can I get the content from listed column types? I remember that I was able to read single text line and choice, but the rest crashed. So I guess I have to convert it any way. But how? IntelliSense doesn’t helps a lot.

SUBQUESTION: I would skip using EcmaScript if you can tell me how to doPostBack to a .cs file where I can use Client Object Model. I found something but didn’t work/ understand.

Yes, I though this will be easy, but it was not. At least because I only know C# a bit, no EcmaScript.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:46:12+00:00Added an answer on May 28, 2026 at 4:46 pm

    Okay, I got a solution Sharepoint.Stackoverflow.com from user Vardhaman Deshpande. This works.

    Here is How to get the value of each type of field:

    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();
    

    from:
    http://www.learningsharepoint.com/2011/07/06/how-to-get-various-item-fields-using-client-object-model-ecmascript-sharepoint-2010/

    UPDATE: The following code is working and tested.

    var item;
    function getItemById(itemId){
    
        var clientContext = new SP.ClientContext.get_current();
    
        var web = clientContext.get_web();
    
        var list = web.get_lists().getByTitle('myList');
    
        item = list.getItemById(itemId);
    
        clientContext.load(item);
    
        clientContext.executeQueryAsync(onSuccess, onFailure);
    }
    function onSuccess(){
    
        alert(item.get_item("My User column").get_lookupValue());
    }
    function onFailure(){
    
        alert('Failure!');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a list in SharePoint 2010, initially had the columns Title, Mobile
I have a problem in Sharepoint 2010. I have a list with two columns,
Does anyone knows if sharepoint 2010 have some kind of limitation related to list
I have a list of fields/columns that comprises of Sharepoint specific fields/columns, my own
We are using SharePoint 2010 Foundation. We have an item in a list that
I have created a custom list in SharePoint 2010 programmatically. It works fine on
I have to refactor some sharepoint 2010 code from my collegue. Everytime he needs
The Sharepoint 2010 Current User Filter Web Part allows List Web Parts that have
I have a calendar list in a SharePoint 2010 enterprise site which uses a
I have a list in Sharepoint 2010 which has a Choice type column that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.