How to get current list item in announcement list using sharepoint app client object model


hello team,

       how current list item in announcement list using sharepoint app client object model .

                                   //gets current item announcement list
                              splistitem announcementlistitem = properties.listitem;

                               //store template layout of current item
                             string templatelayout = convert.tostring(announcementlistitem["templatelayout"]).split('#')[1];
                               //store description of current item
                           string templatedescription = convert.tostring(announcementlistitem["body"]);
                            //store template title of current item
                               string templatetitle = convert.tostring(announcementlistitem["template"]);
                                int itemcount;

and how add in publish field , fallowing code server side how call in client side.

//if publishto field organization add in publish field
            if (publishto == "organization")
            {
                user ouser = properties.web.ensureuser("everyone");
                spfielduservaluecollection value = new spfielduservaluecollection();
                value.add(new fielduservalue(properties.web, ouser.id, ouser.name));
                announcementlistitem["publish"] = value;
                announcementlistitem.update();
            }

please examples .

thanks,

lakshmi


chinnu


please check below thread.

http://social.msdn.microsoft.com/forums/en-us/sharepointdevelopment/thread/9a6010c1-4043-41fc-80a0-29f37acffc29


mcts,mcpd sharepoint 2010. blog- http://www.sharepoint-journey.com
if post answers question, please click "mark answer" on post , "vote helpful



SharePoint  ,  Apps for Office and SharePoint  >  Developing Apps for SharePoint 2013



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

How to send non-standard Content-Type header ?