Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Creating folders programmatically from crm 2013 to sharepoint 2013 document library.

$
0
0

Dear all,

I have dynamics crm 2013 on-premise installed and sharepoint 2013 installed.

I am creating a plugin which will create a document folder automatically when an account is being created.

The folder is not being created.

Can anyone help?

Plaese find below my code:

"

              

 IOrganizationService service = factory.CreateOrganizationService(context.UserId);

                            _clientContext = new ClientContext(_siteUrl);
                            _clientContext.Credentials = new System.Net.NetworkCredential("administrator", "?admin123", "mydomain.local");
                            Web web = _clientContext.Web;

                _clientContext.Load(web);
                _clientContext.ExecuteQuery();

                List newList = web.Lists.GetByTitle(documentLibraryName);


                    FolderCollection foldcoll01 = web.Folders;
                    foldcoll01.Add(_siteUrl + "/" + documentLibraryName + "/" + strAccountName);
                    newList.Update();

Can anyone help me please.

Thanks & Regards

Vinay


Viewing all articles
Browse latest Browse all 8223

Trending Articles



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