2

When I ask for the list collection on a sharepoint site by

Dim collList As ListCollection = Web.Lists
        ctx.Load(collList)
        ctx.ExecuteQuery()

the list "Documenten" appears in the list.

But if I want to address that list with

ctx.Web.Lists.GetByTitle("Documenten")

I get the error that the list is not existing.

If I use

ctx.Web.Lists.GetByTitle("Documents")

it works fine...

So its a language problem.

Question: how can I use "GetByTitle" with a title as it appears in the listcollection?

CDR
  • 21
  • 1

1 Answers1

0

You can try the below to verify the different results:

Ctx.web.Lists.TryGetList(ResourceHelper.GetLocalized("Custom_List_Title", "Resources"));

Or

Ctx.web.Lists.GetByTitle(ResourceHelper.GetLocalized("Custom_List_Title", "Resources"));
Ganesh Sanap - MVP
  • 44,918
  • 21
  • 30
  • 61
SP 2022
  • 4,074
  • 2
  • 13
  • 37
  • Thx for your reply, but these gives me a "Resourcehelper is not declared" error – CDR Mar 09 '20 at 15:38
  • and: "trygetlist" is not a member of listcollection – CDR Mar 09 '20 at 15:42
  • Apparantly this problem only occurs with the "standard" library list "shared documents". This is by the way the list title that is present in the list URL: https://abc.sharepoint.com/sites/MySite/Shared%20Documents/Forms/AllItems.aspx. Conclusion : the list has 3 titles ... – CDR Mar 09 '20 at 15:47