Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

SP client object model create list/library: CustomSchemaXml problem

$
0
0

Hello and nice day for all,

please, can you help me with my problem : I'd like to create list or library on destination SP site which is structural copy of list or library from source SP site. I want to use sorce list schema and bind this schema string into CustomSchema attribute of ListCreationInformation

//create schema info
SP.ListCreationInformation inf = new SP.ListCreationInformation();
string schema = listSource.SchemaXml;
inf.CustomSchemaXml = schema;
listDestination = oWebsite.Lists.Add(inf);
clientContext.Load(listDestination);
clientContext.ExecuteQuery();

But after executing context wuery I always get an error: Not valid schema. Please can you help me, which sections / fields / values I must remove from schema string to be valid ? I tried to remove Fields section, REgionalSettings, WebID attribute .... not effect.

Thank you very much.


Marian


Viewing all articles
Browse latest Browse all 25064

Trending Articles



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