Jan 23 2017 05:15 AM
Hi,
Does anyone know how to change the "Default Welcome Page View" setting from CSOM / C# code? (see attachment)
I found some things can be changed via the DocumentSetTemplate class, but the Default View setting/property I need seems to be missing here?!
Are there any alternatives?
Jan 23 2017 06:11 AM - edited Jan 23 2017 06:12 AM
Hi Thomas,
DocSets' API is limited in CSOM. It's not possible to change most of the settings.
Last time, when I faced DocSets provisioning I ended up with a hack to send emulation of user clicks on a settings form to achieve code based provisioning of DocSet settings.
Jan 23 2017 06:28 AM
**bleep**..., I kinda expected this answer already, never the less i'm still disappointed 😞
The "emulation of user clicks" hack looks really dirty, but then again I don't see another way.
Do you still happen to have the code?
Jan 23 2017 06:41 AM
yes i know it is hard but made a blog for it:
https://docs.com/paul-keijzers/4594/unable-to-change-view-of-list-view-web-part-csom
https://docs.com/paul-keijzers/5882/change-documentsetpage-using-csom-office365
Jan 23 2017 08:10 AM
Hi Paul,
I'm going through your code, If I understand it correctly until now, what you are actually just doing is
- Modify the document set welcome page via the limited webpart manager
- Remove/close the default "document set contents" webpart, which will show only documents in the current document set. This is not an XSLTListViewWebPart zo in the webpart properties, the desired view can not be configured.
- Add an xslt list view webpart. Doing this, a new view is created in the list specifically for this webpart.
- Modify this "webpart view" that has been created in the list as desired.
Nice workaround! I'm going to fit it to my needs, and I'll post an update later to confirm this solves my problem!
Thanks for the feedback!
Regards,
Thomas
Jan 23 2017 10:44 PM
Perfect let me know i needed to remove the webparts as there was a bug which displayed all documentset double at the time.
Mar 31 2018 01:13 PM
Mar 31 2018 01:13 PM
Hi Paul !
I also need to change the Document Set Welcome page with CSOM but I can't access your links. I'm always redirected to Office 365 Home page.
Is it possible for you to send me an other link with your code or maybe a description with an exemple of what you did to change the Document set welcome page ?
Thank's
Jan 20 2020 02:08 AM - edited Jan 22 2020 03:38 AM
That is only doable in sharepoint on premises, here is an explanation for programmatically setting up the document set default view on a list.
=> If you want a **workaround for sharepoint online**, please use this powershell docset welcomepage view setter and follow this example