koltyakov / gosip

⚡️ SharePoint SDK for Go
https://go.spflow.com
MIT License
145 stars 33 forks source link

Issue with creating List view #29

Closed swapnilgaonkar closed 4 years ago

swapnilgaonkar commented 4 years ago

We are creating list views. During creation we are passing 'ViewType' as 'CALENDER' as mentioned below createMetadata["ViewType"] = "CALENDER". But still view gets created with type HTML.

Even if we try to create view of type field, 'ViewFields are not getting created.'

If we get existing list view using library code, we can see that all fields are present in 'ListViewXML' as below sample.

<View Name="{F2B2777A-7608-4EF8-80DC-786260376474}" Type="HTML" DisplayName="All Test Documents View" Url="/sites/commsite12/Shared Documents/Forms/All Test Documents View.aspx" Level="1" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/15/images/dlicon.png?rev=47" ><Query><OrderBy><FieldRef Name="FileLeafRef" /></OrderBy></Query><ViewFields><FieldRef Name="DocIcon" /><FieldRef Name="LinkFilename" /><FieldRef Name="Modified" /><FieldRef Name="Editor" /><FieldRef Name="Mylocation" /><FieldRef Name="City" /><FieldRef Name="CountryOrRegion" /><FieldRef Name="SampleTest" /></ViewFields><RowLimit Paged="TRUE">30</RowLimit><Aggregations Value="Off" /><JSLink>clienttemplates.js</JSLink><XslLink Default="TRUE">main.xsl</XslLink><ViewData /><Toolbar Type="Standard"/></View>

For e.g. If we try to create new view using above ListViewXML, 'SampleTest' is not getting added to view.

Can you please provide some help

koltyakov commented 4 years ago

Shouldn’t it be “Calendar”?

Can you provide a complete sample you’re trying?

koltyakov commented 4 years ago

I'm not even sure that it's feasible to create a Calendar view via REST API at all, no matter I tried copying all the fields from a view created in the UI. With REST, it always ends up with a default ViewTypeKind.

koltyakov commented 4 years ago

Also, I'm not sure, should we even consider adding CSOM helper(s) for this. View types are such on an old legacy that is never used at all these days. And are recommended not being used even in On-Prem and especially in SharePoint Online which is aiming away from classic outdated stuff.

swapnilgaonkar commented 4 years ago

Thanks for the help. We also tried all the combinations but still view gets created with default ViewTypeKind(HTML). We are ignoring view creation for time being as it is legacy functionality as you mentioned.