Quantcast
Channel: Microsoft Online: SharePoint Online forum
Viewing all articles
Browse latest Browse all 10096

How to create SPlist template using csom

$
0
0

I have a sharepoint list. I want list to save as template using CSOM. Help me!!!

                            

using (SPSite oSPsite = new SPSite(strSiteURL))
                    {
                        oSPsite.AllowUnsafeUpdates = true;
                        using (SPWeb oSPWeb = oSPsite.OpenWeb())
                        {
                            oSPWeb.AllowUnsafeUpdates = true;
                            SPList list = oSPWeb.Lists[strListName];
                            string strbkpTemplateName = strListName + ".stp";
                            list.SaveAsTemplate(strbkpTemplateName, strbkpTemplateName.Replace(".stp", ""), "Description", isFlag);

                            list.Update();
                            oSPWeb.AllowUnsafeUpdates = false;
                        }
                        oSPsite.AllowUnsafeUpdates = false;
                    }

Same thing i want using csom





Viewing all articles
Browse latest Browse all 10096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>