# setSubtreeHidden not working

**URL:** <https://forum.universal-robots.com/t/setsubtreehidden-not-working/29487>\
**Category:** Java\
**Created:** [July 11, 2023, 3:26pm UTC](https://forum.universal-robots.com/t/setsubtreehidden-not-working/29487 "2023-07-11T15:26:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathan.churchill](https://avatars.discourse-cdn.com/v4/letter/n/a8b319/32.png) [@nathan.churchill](https://forum.universal-robots.com/u/nathan.churchill)\
**Post date:** [July 11, 2023, 3:26pm UTC](https://forum.universal-robots.com/t/setsubtreehidden-not-working/29487/1 "2023-07-11T15:26:38Z")

</div>

Using this code to set a subtree as hidden and it doesnt appear to be working?

```
    ProgramNodeFactory nf = programModel.getProgramNodeFactory();
    
    FolderNode folderNode = nf.createFolderNode();
    folderNode.setName(name);
    folderNode.setSubtreeHidden(true);
    return folderNode;

```

This is the error:

```
    cannot find symbol
    [ERROR] symbol: method setSubtreeHidden(boolean)

```

Any help would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)\
**Post date:** [July 11, 2023, 3:37pm UTC](https://forum.universal-robots.com/t/setsubtreehidden-not-working/29487/2 "2023-07-11T15:37:04Z")

</div>

Are you using at least API version 1.12?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/3/30d86c7f727dba0e32f597872f7be97253518270.png)

That’s a fairly new API (I think the current is 1.13) so if you’re using this on a slightly older build, it might not see it. You can find this in your POM under dependencies:

```auto
<dependency>
	<groupId>com.ur.urcap</groupId>
	<artifactId>api</artifactId>
	<version>1.10.0</version>
	<scope>provided</scope>
</dependency>

```

In this case, my CAP that is currently on 1.10 would also not be able to access this method.

---

<div class="post-metadata">

**Author:** ![nathan.churchill](https://avatars.discourse-cdn.com/v4/letter/n/a8b319/32.png) [@nathan.churchill](https://forum.universal-robots.com/u/nathan.churchill)\
**Post date:** [July 11, 2023, 3:59pm UTC](https://forum.universal-robots.com/t/setsubtreehidden-not-working/29487/3 "2023-07-11T15:59:42Z")

</div>

Amazing thank you! Was using the new API but hadnt changed the POM
