cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

How to programmatically create "folder" on Project Context.

ptc-5172199
1-Newbie

How to programmatically create "folder" on Project Context.

Hi,

There is a way to automatically create a folder in a project ?

Someone has an example like this in case create a folder within a project

Thanks for the info that can provide me.

example: create folder in aproduct.

java.png

2 REPLIES 2
LoriSood
22-Sapphire II
(To:ptc-5172199)

Ezio,

You should be able to use similar code, but instead of instantiating a PDMLinkProduct you instantiate a Project2 object:

Project2 project= <SOMETHING>;

WTContainerRef projCref = WTContainerRef.newWTContainerRef(project);

SubFolder f4 = FolderHelper.service.createSubFolder("/Default/Folder4", project.getDefaultDomainReference(), projCref);

Hi Lori,

In case the project is different but thank you.

Ezio.

See this example of code java.

ObjectIdentifier oid = ObjectIdentifier.newObjectIdentifier("wt.projmgmt.admin.Project2:144335");

Project2 project = (Project2) PersistenceHelper.manager.refresh(oid);

WTContainerRef project_ref = WTContainerRef.newWTContainerRef(oid);


Top Tags