Find your content:

Search form

You are here

How to query the content workspace id in apex


How to query the content workspace id in apex? As of now am hardcoding it.. Can someone suggest a way?

Attribution to: Sathya

Possible Suggestion/Solution #1

You can query the ContentWorkspace standard object from Apex. I just created a library in my DE org, then, from the Developer Console, executed

List<ContentWorkspace> cwl = [select Id, Name, Description from ContentWorkspace];
for (ContentWorkspace cw : cwl) {

This gives me

10:41:02:058 USER_DEBUG [3]|DEBUG|ContentWorkspace:{Name=My Lib, Description=A library, Id=05850000000TX7XAAW}

Attribution to: metadaddy
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content