Error occur when importing web part using Client Object Model API

                i try to update webpart properties using Client API for some view and form pages. and the following error occured:
view: /sites/metadata des02/frank metadata library/Forms/Thumbnails.aspx
ERROR 03-06 05:36:47,720 Microsoft.SharePoint.Client.ServerException: The specified program requires a newer version of Windows. (Exception from HRESULT: 0x8007047E)
   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
   at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
   at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
   at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
   at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
/sites/metadata des02/frank metadata library/Forms/Combine.aspx, ERROR 03-06 05:36:53,235  Microsoft.SharePoint.Client.ServerException: The specified program requires a newer version of Windows. (Exception from HRESULT: 0x8007047E)
   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
   at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
   at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
   at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
   at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
/sites/metadata des02/frank metadata library/Forms/Upload.aspx,
ERROR 03-06 05:36:55,204 Microsoft.SharePoint.Client.ServerException: Exception has been thrown by the target of an invocation.
   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
   at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
   at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
   at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
   at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
/sites/metadata des02/frank metadata library/Forms\EditForm.aspx ERROR 03-06 05:36:56,470 Microsoft.SharePoint.Client.ServerException: Exception from HRESULT: 0x80131904
   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
   at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
   at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
   at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
   at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
   at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()

Hi Ramakrishnaraja,
here is the code snippet:
using (ClientContext context = new ClientContext("https://frankkk.sharepoint.com/sites/metadata des02"))
                    context.Credentials = spoc as SharePointOnlineCredentials;
                    File webPartPage = context.Web.GetFileByServerRelativeUrl("/sites/metadata des02/frank metadata library/Forms/EditForm.aspx");
                    List list = context.Web.Lists.GetByTitle("frank metadata library");
                    LimitedWebPartManager limitedWebPartManager = webPartPage.GetLimitedWebPartManager(PersonalizationScope.Shared);
                    context.Load(webPartPage);
                    context.Load(limitedWebPartManager);
                    context.Load(limitedWebPartManager, manager => manager.WebParts);
                    if (list != null)
                        context.Load(list, l => l.Views.IncludeWithDefaultProperties(v => v.ViewFields.SchemaXml));
                    context.ExecuteQuery();                    

Similar Messages

  • How to change 'Modified By' column value when a new file is uploaded in SharePoint 2013 using Client Object Model?

    I want to change 'Modified By' column value of a file that is being uploaded using Client Object Model in SharePoint 2013. The problem is that the version of the file is changing. Kindly help me. The code that I am using is:
    using (System.IO.Stream fileStream = System.IO.File.OpenRead(m_strFilePath))
        Microsoft.SharePoint.Client.File.SaveBinaryDirect(m_clientContext, str_URLOfFile, fileStream, true);
        Microsoft.SharePoint.Client.File fileUploaded = m_List.RootFolder.Files.GetByUrl(str_URLOfFile);
        m_clientContext.Load(fileUploaded);
        m_clientContext.ExecuteQuery();
        User user1 = m_Web.EnsureUser("User1");
        User user2 = m_Web.EnsureUser("User2");
        ListItem item = fileUploaded.ListItemAllFields;
        fileUploaded.CheckOut();
        item["UserDefinedColumn"] = "UserDefinedValue1";
        item["Title"] = "UserDefinedValue2";
        item["Editor"] = user1;
        item["Author"] = user2;
        item.Update();
        fileUploaded.CheckIn(string.Empty, CheckinType.OverwriteCheckIn);
        m_clientContext.ExecuteQuery();

    Hi talib2608,
    Chris is correct for this issue, when calling update using ListItem.update method, it will increase item versions, using SystemUpdate and UpdateOverwriteVersion will update the list item overwrite version.
    these two methods are not available in CSOM/REST, only server object model is available for this.
    Thanks,
    Qiao Wei
    TechNet Community Support

  • Unable to get the SharePoint 2013 List names using Client object model for the input URL

    Please can you help with this issue.
    We are not able to get the SharePoint 2013 List names using Client object model for the input URL.
    What we need is to use default credentials to authenticate user to get only those list which he has access to.
    clientContext.Credentials = Net.CredentialCache.DefaultCredentials
    But in this case we are getting error saying ‘The remote server returned an error: (401) Unauthorized.’
    Instead of passing Default Credentials, if we pass the User credentials using:
    clientContext.Credentials = New Net.NetworkCredential("Administrator", "password", "contoso")
    It authenticates the user and works fine. Since we are developing a web part, it would not be possible to pass the user credentials. Also, the sample source code works perfectly fine on the SharePoint 2010 environment. We need to get the same functionality
    working for SharePoint 2013.
    We are also facing the same issue while authenticating PSI(Project Server Interface) Web services for Project Server 2013.
    Can you please let us know how we can overcome the above issue? Please let us know if you need any further information from our end on the same.
    Sample code is here: http://www.projectsolution.com/Data/Support/MS/SharePointTestApplication.zip
    Regards, PJ Mistry (Email: [email protected] | Web: http://www.projectsolution.co.uk | Blog: EPMGuy.com)

    Hi Mistry,
    I sure that CSOM will authenticate without passing the
    "clientContext.Credentials = Net.CredentialCache.DefaultCredentials" by default. It will take the current login user credentials by default. For more details about the CSOM operations refer the below link.
    http://msdn.microsoft.com/en-us/library/office/fp179912.aspx
    -- Vadivelu B Life with SharePoint

  • How to activate Custom Feature in SharePoint 2010 using Client Object model

    I am trying to Activate a custom feature using Client Object Model in SharePoint 2010. Here is the code I used. When I execute the code, I got the error "Feature with Id 'xx' is not installed in this farm, and cannot be added to this scope while
    creating site collection". Can anyone help?
    ClientContext clientContext = new ClientContext(spURL);
    //GUID of the custom feature                    
    Guid districtFeatureId = new Guid("5b3529de-5045-46da-af87-8d2e32c121a7");
    Site clientSite = clientContext.Site;
    FeatureCollection clientSiteFeatures = clientSite.Features;
    clientContext.Load(clientSiteFeatures);
    clientContext.ExecuteQuery();
    //Activate the feature
    clientSiteFeatures.Add(districtFeatureId, false, FeatureDefinitionScope.Site);
    clientContext.ExecuteQuery();

    Hi shil chan,
    When you activate a feature on the site collection, the feature should be scoped to site or farm, the error message shows it cannot find the specific feature, this will happen when you have a feature in web
    scope or the feature isn’t installed.  
    So, to troubleshooting this issue:
    Verify whether the feature is scoped to web. Please go to
    Site Setting->Site Features . If the feature is a web scope feature, then add the feature to webfeatures.
    Make sure the feature is installed correctly.
    Please inform me freely if you have any questions.
    Thanks

  • Not able to use Client Object Model in Visual Webpart SandBox Solution?

    Hi,
    I am trying to use client object model in visual webpart in sandbox solution but i am getting unexpected error but if i remove client object model code webpart works fine?
    any help is appreciated.
    Regards,
    Gaurav Verma

    Check this article for your answer
    How to leverage the Client Object Model in a Sandbox Visual Web Part
    Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL
    INSQLSERVER.COM
    Mohammad Nizamuddin

  • Quering the database using Client Object Model

    Hi,
    I have to fetch the list items from a list named "Project Status" and display it in a table using
    Client Object model.
    The equivalent server side code is:
    SPWeb web = SPContext.Current.Web;
    SPList list = web.Lists["Project Status"];
    DataTable dt1 = new DataTable();
    try
    if (list.ItemCount > 0)
    DataColumn dc;
    DataColumn dc1;
    dc = new DataColumn("ProjectId", Type.GetType("System.String"));
    dc1 = new DataColumn("Project Name", Type.GetType("System.String"));
    dt1.Columns.Add(dc);
    dt1.Columns.Add(dc1);
    DataRow dr;
    foreach (SPListItem item in list.Items)
    dr = dt1.NewRow();
    dr["ProjectId"] = item["ProjectId"];
    dr["Project Name"] = item["Project Name"];
    dt1.Rows.Add(dr);
    Repeater1.DataSource = dt1;
    Repeater1.DataBind();
    catch (Exception Ex)
    throw Ex;
    1 more issue what i face is providing two links in the Visual WebPart and their navigate url is based on a condition that is fetched from the database. This corresponding code has to be converted to
    Client Object Model.
    string user = web.CurrentUser.LoginName;
    string userID = user.Split(new char[] { '\\' })[1];
    string connString = @"Data Source=NorthWind;Initial Catalog=EmployeeDB;User ID=sa;Password=Newuser123";
    string query = "select * from EMPLOYEE_PROFILE";
    SqlConnection conn = new SqlConnection(connString);
    SqlCommand cmd = new SqlCommand(query, conn);
    try
    conn.Open();
    DataTable t1 = new DataTable();
    using (SqlDataAdapter a = new SqlDataAdapter(cmd))
    a.Fill(t1);
    DataRow[] dr = t1.Select("PsNo = '" + userID + "'"); //This will select all rows where the Name Column has current user
    foreach (DataRow r in dr)
    string bU = r["DeputedBU"].ToString();
    if (bU == "INS" || bU == "BFS")
    lnkPM.NavigateUrl = web.Site.WebApplication.Sites[0].Url + "/Dashboard.aspx";
    lnkSummary.NavigateUrl = web.Site.WebApplication.Sites[0].Url + "/DashboardWithHyperlinks.aspx";
    else
    lnkPM.Visible = false;
    lnkSummary.Visible = false;
    catch (Exception)
    throw;
    finally
    conn.Close();
    Any help would be appreciated.

    Hi,
    According to your post, there would be two questions in this single thread.
    It is recommended to post one question in one single thread which will make others easier to focus on one question in one thread.
    For the first question, you want to fetch list items and put into a DataTable object using Client Object Model.
    To fetch list items from a list using Client Object Model, you can take a look at the code snippet below from MSDN:
    http://msdn.microsoft.com/en-us/library/office/ee534956(v=office.14).aspx
    For the second question, you might need to retrieve the User object and site collections object using Client Object Model.
    However, if you can develop a Visual Web Part for your site, it means that you will be able to access the SharePoint Object Model which has more powerful APIs, so there is no
    need to use Client Object Model in a Visual Web Part.
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to get list of users who all are having full access in sharepoint site using client object model c#

    Hi,
    I want to fetch the list of users who all are having full access to the sharepoint list using client object model with .Net
    Please let me know if any property for the user object or any other way to get it.
    Thanks in advance.

    Here you are complete code i created from some years it lists all groups and users, you can just add a check in the permissions loop to see if it is equal to Full Control.
    Private void GetData(object obj)
    MyArgs args = obj as MyArgs;
    try
    if (args == null)
    return; // called without parameters or invalid type
    using (ClientContext clientContext = new ClientContext(args.URL))
    // clientContext.AuthenticationMode = ClientAuthenticationMode.;
    NetworkCredential credentials = new NetworkCredential(args.UserName, args.Password, args.Domain);
    clientContext.Credentials = credentials;
    RoleAssignmentCollection roles = clientContext.Web.RoleAssignments;
    ListViewItem lvi;
    ListViewItem.ListViewSubItem lvsi;
    ListViewItem lvigroup;
    ListViewItem.ListViewSubItem lvsigroup;
    clientContext.Load(roles);
    clientContext.ExecuteQuery();
    foreach (RoleAssignment orole in roles)
    clientContext.Load(orole.Member);
    clientContext.ExecuteQuery();
    //name
    //MessageBox.Show(orole.Member.LoginName);
    lvi = new ListViewItem();
    lvi.Text = orole.Member.LoginName;
    lvsi = new ListViewItem.ListViewSubItem();
    lvsi.Text = orole.Member.PrincipalType.ToString();
    lvi.SubItems.Add(lvsi);
    //get the type group or user
    // MessageBox.Show(orole.Member.PrincipalType.ToString());
    if (orole.Member.PrincipalType.ToString() == "SharePointGroup")
    lvigroup = new ListViewItem();
    lvigroup.Text = orole.Member.LoginName;
    // args.GroupsList.Items.Add(lvigroup);
    DoUpdate1(lvigroup);
    Group group = clientContext.Web.SiteGroups.GetById(orole.Member.Id);
    UserCollection collUser = group.Users;
    clientContext.Load(collUser);
    clientContext.ExecuteQuery();
    foreach (User oUser in collUser)
    lvigroup = new ListViewItem();
    lvigroup.Text = "";
    lvsigroup = new ListViewItem.ListViewSubItem();
    lvsigroup.Text = oUser.LoginName;
    lvigroup.SubItems.Add(lvsigroup);
    //args.GroupsList.Items.Add(lvigroup);
    DoUpdate1(lvigroup);
    // MessageBox.Show(oUser.LoginName);
    RoleDefinitionBindingCollection roleDefsbindings = null;
    roleDefsbindings = orole.RoleDefinitionBindings;
    clientContext.Load(roleDefsbindings);
    clientContext.ExecuteQuery();
    //permission level
    lvsi = new ListViewItem.ListViewSubItem();
    string permissionsstr = string.Empty;
    for (int i = 0; i < roleDefsbindings.Count; i++)
    if (i == roleDefsbindings.Count - 1)
    permissionsstr = permissionsstr += roleDefsbindings[i].Name;
    else
    permissionsstr = permissionsstr += roleDefsbindings[i].Name + ", ";
    lvsi.Text = permissionsstr;
    lvi.SubItems.Add(lvsi);
    // args.PermissionsList.Items.Add(lvi);
    DoUpdate2(lvi);
    catch (Exception ex)
    MessageBox.Show(ex.Message);
    finally
    DoUpdate3();
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation

  • Setting the default value to taxonomy column in sharepoint 2010 using client object model

    I am creating a metadata column and I want to set its default value in sharepoint 2010 using client object model. Can anyone help me?
    My code for creating metadata column is as below:
                ClientContext clientContext = new ClientContext(siteUrl);
                Web site = clientContext.Web;
                List list = site.Lists.GetByTitle("LibraryName");
                FieldCollection collField = list.Fields;
                string fieldSchema = "<Field Type='TaxonomyFieldType' DisplayName='SoftwareColumn' Name='SoftwareColumn' />";
                collField.AddFieldAsXml(fieldSchema, true, AddFieldOptions.DefaultValue);
                //oneField.DefaultValue = "ASP.NET|4c984b91-b308-4884-b1f1-aee5d7ed58b2"; // wssId[0].ToString() + ";#" + term.Name + "|" + term.Id.ToString().ToLower();
                clientContext.Load(collField);           
                clientContext.ExecuteQuery();

    Hi,
    Please try the code like this:
    ClientContext clientContext = new ClientContext("http://yoursite/");
    List list = clientContext.Web.Lists.GetByTitle("List1_mmsfield");
    clientContext.Load(list);
    clientContext.ExecuteQuery();
    FieldCollection fields = list.Fields;
    clientContext.Load(fields);
    clientContext.ExecuteQuery();
    Field f = fields.GetByTitle("mms");
    clientContext.Load(f);
    clientContext.ExecuteQuery();
    Console.WriteLine(f.Title + "---" + f.DefaultValue);
    //2;#A2|a0a95267-b758-4e4d-8c39-067069fd2eef
    //1;#A1|641f5726-992c-41c8-9ddc-204a60b88584
    f.DefaultValue = "1;#A1|641f5726-992c-41c8-9ddc-204a60b88584";
    f.Update();
    clientContext.Load(f);
    clientContext.ExecuteQuery();
    Console.WriteLine(f.Title + "---" + f.DefaultValue);
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to Enable Ratings on SharePoint List using Client Object Model for Office 365 SharePoint Site.

    How to Enable Ratings on SharePoint List using Client Object Model code for Office 365 SharePoint Site.
    Thanks in Advance
    Rajendra K

    Hi Rajendra,
    here you are the code and the blog, let me know if this helps
    using (ClientContext ctx = new ClientContext(https://yourSiteUrl))
    Web w = ctx.Web;
    List l = w.Lists.GetByTitle("yourListName");
    ctx.Load(l, info => info.Id);
    ctx.ExecuteQuery();
    string ListID = l.Id.ToString();
    Microsoft.Office.Server.ReputationModel.Reputation.SetRating(ctx, ListID, 1, 5);
    ctx.ExecuteQuery();
    http://blogs.technet.com/b/speschka/archive/2013/07/08/how-to-use-csom-with-ratings-in-sharepoint-2013.aspx
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation

  • Assign Group permission to list item using client object model

    Hi,
       I am trying to add the list item and assign the permission to the list item by using SP 2010 client object model. The problem which i am facing that when i assign the group as a permission to the item, by automatically the limited access permission
    is added to the group. Please find the steps which i have followed,
    Step-1: Break role inheritance.
     foreach (var item in _listItemCollection)
                            if (item["FileLeafRef"].ToString().ToLower() == "xxx")
                                item.BreakRoleInheritance(true, false);
                                _clientContext.Load(item.RoleAssignments);
                                _folderItem = item;
    _clientContext.ExecuteQuery();
    Step 2: Remove all permissions of the list item.
       foreach (var assignment in _folderItem.RoleAssignments)
                        assignment.RoleDefinitionBindings.RemoveAll();
                        assignment.Update();
    _clientContext.ExecuteQuery();
    Step 3:
        Add Group as a permission to the list item.
      var role = _web.RoleDefinitions.GetByType(RoleType.Contributor);
                    var collRdb = new RoleDefinitionBindingCollection(_clientContext) { role };
                    Principal principal = _grp;
                    _folderItem.RoleAssignments.Add(principal, collRdb);
                    _folderItem.Update();
    _clientContext.ExecuteQuery();
        After adding the group successfully to the list item, i checked the group permission and it contains the value as "Contribute,Limited Access" to the site level and "Contribute" to the list item. Please guide me how to avoid to create Contribute,Limited
    Access role.
    Balaji

    Hi Dmitry,
      When I create the group and assign contribute permission, the group has the permission at the site level(to see the permission, click group and click view Group Permission).  I have added the list item and break the role inheritance permission
    and given the unique permission by providing group as a permission to the list item. After providing the permission, the group permission at the site level changed to "Contribute, Limited Access". I dont know how contribute permission changed to contribute,
    limited access.
    I found the workaround to fix this issue. I created the group and create the folder in the shared document library by using client object model. Due to facing some issue by providing the permission using client object model, i have created the event receiver
    to the document library and using server object model, i can able to assign the approprate group permission.
    Balaji

  • Delete site collection using Client object model

    Is it possible to delete a site collection using Client object model?
    -Prashant

    I don't think you can create or delete a site-collection using SharePoint Client Object Model. You'd need to leverage admin web services (
    http://Site/_vti_adm/Admin.asmx) (or) server-side object model (or) powershell for this task.
    Please mark the replies as answers if they help or unmark if not.

  • Parsing Query string using Client Object model [ECMA]

    hello
    i want to access querystring using client object model using ECMA script.
    for eg http://localhost:80/demopage.aspx?test=123
    can we read value of test using ECMA script
    regards
    Manish

    thanks ...
    i did that...using
    <script type="text/javascript">
    function queryString(parameter) {
    var loc = location.search.substring(1, location.search.length);
    var param_value = false;
    var params = loc.split("&");
    for (i=0; i<params.length;i++) {
    param_name = params[i].substring(0,params[i].indexOf('='));
    if (param_name == parameter) {
    param_value = params[i].substring(params[i].indexOf('=')+1)
    if (param_value) {
    return param_value;
    else {
    return false; //Here determine return if no parameter is found

  • Unable to update rating (rating column) on host document using JavaScript Object Model API inside sharepoint hosted apps

    Hi Everyone,
    We are developing SharePoint hosted apps for Office 365, for that we are going
    to implement document rating functionality inside Sharepoint app. The host web contain document library (“Documents”) and from apps we need to rate each document. The rating functionality working fine with CQWP in team site  using
    JavaScript Object Model API.
    But the same code is not working inside apps and giving error:-
    If we are using app context than error will be:-
    "List does not exist.
    The page you selected contains a list that does not exist.  It may have been deleted by another user."
    And for Host context than error will be:-
    "Unexpected response data from server."
    Please help on this
    Please see below code..
    'use strict';
    var web, list, listItems, hostUrl, videoId, output = "";
    var videoLibrary = "Documents";
    var context, currentContext;
    var lists, listID;
    var list, parentContext;
    var scriptbase;
    (function () {
        // This code runs when the DOM is ready and creates a context object which is 
        // needed to use the SharePoint object model
        $(document).ready(function () {
            hostUrl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
            context = SP.ClientContext.get_current();      
            SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sharePointReady);
        function sharePointReady() {
            scriptbase = hostUrl + "/_layouts/15/";
            // Load the js files and continue to the successHandler
            $.getScript(scriptbase + "SP.Runtime.js", function () {
                $.getScript(scriptbase + "SP.js", function () {
                    $.getScript(scriptbase + "SP.Core.js", function () {
                        $.getScript(scriptbase + "reputation.js", function () {
                            $.getScript(scriptbase + "sp.requestexecutor.js", execCrossDomainRequest);
        //Query list from hostweb
        function execCrossDomainRequest() {       
            //Load the list from hostweb
            parentContext = new SP.AppContextSite(context, hostUrl);
            web = parentContext.get_web();
            list = web.get_lists().getByTitle(videoLibrary);
            context.load(list, 'Title', 'Id');
            var camlQuery = new SP.CamlQuery();
            camlQuery.set_viewXml('<View><Query><OrderBy><FieldRef Name="Modified" Ascending="FALSE"/></OrderBy></Query><RowLimit>1</RowLimit></View>');
            listItems = list.getItems(camlQuery);        
            context.load(listItems);
            context.executeQueryAsync(onQuerySucceeded, onQueryFailed);
        //Process the image library
        function onQuerySucceeded() {       
            var lstID = list.get_id();
            var ctx = new SP.ClientContext(hostUrl);       
            var ratingValue = 4;
            EnsureScriptFunc('reputation.js', 'Microsoft.Office.Server.ReputationModel.Reputation', function() {      
            Microsoft.Office.Server.ReputationModel.Reputation.setRating(ctx, lstID, 1, ratingValue);       
            ctx.executeQueryAsync(RatingSuccess, RatingFailure);
        function onQueryFailed(sender, args) {
            alert('Failed' + args.get_message());
        function failed(sender, args) {
            alert("failed because:" + args.get_message());
        function RatingSuccess() {
            alert('rating set');
            //displaystar();
        function RatingFailure(sender, args) {
            alert('Rating failed : : ' + args.get_message());
        //Gets the query string paramter
        function getQueryStringParameter(paramToRetrieve) {
            var params;
            params = document.URL.split("?")[1].split("&");
            for (var i = 0; i < params.length; i = i + 1) {
                var singleParam = params[i].split("=");
                if (singleParam[0] == paramToRetrieve) return singleParam[1];
    Thanks & Regards
    Sanjay 
    Thank you in advance! :-)
          

    Hi,
    According to your post, my understanding is that you want to update list column in SharePoint hosted apps using JavaScript Client Object Model.
    Based on the error message, it seems not retrieve the list object in context. I suggest you debug the code step by step using Internet Explorer Developer Tools to
    find the problem.
    Here are some demos about using JavaScript Client Object Model in SharePoint hosted app:
    http://blogs.msdn.com/b/officeapps/archive/2012/09/04/using-the-javascript-object-model-jsom-in-apps-for-sharepoint.aspx
    http://sharepoint.stackexchange.com/questions/55334/how-to-access-list-in-sharepoint-hosted-app
    http://www.dotnetcurry.com/showarticle.aspx?ID=1028
    Best regards
    Zhengyu Guo
    TechNet Community Support

  • How to execute XML batch commands using SharePoint Web services or Client Object Model

    Hi,
    I have a requirement to execute some batch commands to update SharePoint View Style, how can i do it using SharePoint webservices or SharePoint Client Object model.
          I need to execute the following Batch command over a particular web.
    <Method ID="UpdateView">
      <SetVar Name="Cmd">UpdateView</SetVar>
      <SetList Scope="Request">{GUID of List}</SetList>
      <SetVar Name="View">{GUID of View}</SetVar>  
      <SetVar Name="ViewStyle">6</SetVar>
      <SetVar Name="RowLimit">100</SetVar>
      <SetVar Name="Paged">TRUE</SetVar>
    </Method>

    Hi
    I tried it already... But UpdateView Method in the Views.asmx and Lists.asmx, both are not supporting for updating the style of the view (like Boxed, Newsletter...).
    If you have any code sample which will do this job with any of the SharePoint web services, please share it..

  • Cannot create list in SharePoint 2010 using Client Object Model

    I am trying to utilize SharePoint 2010 Client Object Model to create a List based on a custom template. Here's my code:
    public void MakeList(string title, string listTemplateGUID, int localeIdentifier)
    string message;
    string listUrl;
    List newList;
    Guid template;
    ListCreationInformation listInfo;
    Microsoft.SharePoint.Client.ListCollection lists;
    try
    listUrl = title.Replace(spaceChar, string.Empty);
    template = GetListTemplate((uint)localeIdentifier, listTemplateGUID);
    listInfo = new ListCreationInformation();
    listInfo.Url = listUrl;
    listInfo.Title = title;
    listInfo.Description = string.Empty;
    listInfo.TemplateFeatureId = template;
    listInfo.QuickLaunchOption = QuickLaunchOptions.On;
    clientContext.Load(site);
    clientContext.ExecuteQuery();
    lists = site.Lists;
    clientContext.Load(lists);
    clientContext.ExecuteQuery();
    newList = lists.Add(listInfo);
    clientContext.ExecuteQuery();
    catch (ServerException ex)
    Now, this particular part, newList = lists.Add(listInfo); clientContext.ExecuteQuery();, the one that is supposed to create the actual list, throws an exception:
    Message: Cannot complete this action. Please try again.
    ServerErrorCode: 2130239231
    ServerErrorTypeName: Microsoft.SharePoint.SPException
    Could anyone please help me realize what am I doing wrong? Thanks.

    I've made progress - well, at least to some extent. The previous message related to the "Invalid file name" is not appearing any more. I now realize that it is necessary to specify feature ID, list template kind, as well as custom schema in order
    to order SharePoint 2010 to create the document library. 
    However, there's a new problem which isn't documented on the net almost at all (at least I was unable to find anything): The document library gets created, but I cannot access it. Further inspection showed that the doc lib views are not created. Basically,
    the only accessible doc lib page is the document library settings page. Also, I get the server exception with the message: 
    Server Out Of Memory. There is no memory on the server to run your program. Please contact your administrator with this problem.
    Any idea what is causing this issue? Thanks. 
    Hi Boris
    Borenović,
    I think I found the reason for this notorious "Server Out Of Memory" error.
    (Man, it took 4 hrs of frustrating troubleshooting without any direct hints... very disappointing
    MSFT developers :( ).
    Anyway,
    All the "Form" elements at the bottom need to have SetupPath="pages\form.aspx"
    attribute (by default this attrib is missing when you copy the whole List element from inside the stp's manifest.xml  file).
    Also, just make sure that each "View" element has correct "WebPartZoneID", "SetupPath" and "Url" attribute values otherwise that list/library will
    be created successfully but will fail to load when you try to access it (with the VERY helpful "Cannot complete this action, contact administrator" error). Even if you enable stack trace (or check ULS logs) you will find "An unexpected
    error has been encountered in this Web Part.  Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe." and you will never realize it's because of the
    incorrect attributes ("WebPartZoneID", "SetupPath" or "Url" as mentioned above).
    Come on Microsoft, you can do better than that?
    If the API needs this attrib then why is it missing inside the manifest.xml file when
    an STP file generated in the first place?

Maybe you are looking for

  • Skip when shuffling?

    It seems to be okay when I'm listening to music on my computer but it does not work when I'm listening on my iPod (60GB/photo). What do I have to do to sync the iPod with this preference in mind? I did a search and found something similar but it wasn

  • JDBC RowSet DML Sample

    Hello, Excuses for school English + google, With javac : error: AirlinesDML.java:42: unreported exception java.sql.SQLException; must be caught or declared to be thrown private static RowSet rowset = new OracleJDBCRowSet(); With Java version "1.5.0_0

  • Filter Gallery Problems

    1 - Distort: Diffuse Glow, with Graininess = 1, Glow Amount = 8, Clear Amount = 11.  Image  is almost all lime green.  Only the figu re in the image is not green. 2 - Sketch: Stamp, with Light/Dark Balance = 1, Smoothness = 2.  Almost all lime green.

  • Fireworks CS3

    Are .ase files compatible with Fireworks CS3? Does anyone know?

  • Nano problems with itunes

    How are yas? Ok I am having serious problems getting my Nano to be recognized by itunes. The Nano is recognized by both windows and the ipod updater but there is no option to update in itunes itself. If i connect the ipod to my usb it will fire up it