Jul 14 2022 06:04 AM - edited Jul 14 2022 06:10 AM
ListCreationInformation.QuickLaunchOption seems to be ignored when creating a list on sharepoint online with CSOM.
How can I achieve the same goal?
Jul 15 2022 02:55 AM
SolutionI accomplished this by adding the following code after creating the list:
'Menu QuickLaunch
If listInfo.QuickLaunchOption = QuickLaunchOptions.On Then
Dim quickLaunchCollection As NavigationNodeCollection = wWeb.Navigation.QuickLaunch
context.Load(quickLaunchCollection)
context.ExecuteQuery()
If quickLaunchCollection.Where(Function(nn) String.Equals(nn.Url, lList.RootFolder.ServerRelativeUrl, StringComparison.OrdinalIgnoreCase)).Any = False Then
Dim navigationNodeCreationInformation As NavigationNodeCreationInformation = New NavigationNodeCreationInformation()
navigationNodeCreationInformation.Title = If(String.IsNullOrEmpty(listInfo.Title), "josh " & DateTime.Now.ToString("yyyyMMdd HHmmss"), listInfo.Title)
navigationNodeCreationInformation.Url = lList.RootFolder.ServerRelativeUrl
navigationNodeCreationInformation.AsLastNode = True
quickLaunchCollection.Add(navigationNodeCreationInformation)
context.ExecuteQuery()
End If
End If