Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
I am trying to create a change activity object using java api and im getting the following error when i run it,
this error is occuring at FolderHelper.assignLocation(changeTask, folder_path_in_windchill);
wt.folder.FolderException:
A cabinet member must be assigned to a cabinet, not a subfolder. Cabinet member: "(Default task) Modify affected objects". Subfolder: "(Default task) Modify affected objects=.
at wt.folder.FolderHelper.assignLocations(FolderHelper.java:838)
at wt.folder.FolderHelper.assignLocation(FolderHelper.java:142)
Change activity is not folder based object. It's a CabinetMember instead, so you can only assign it to the root folder.
Try to get the root folder first (containerRef is the context ref):
Folder folder = FolderHelper.service.getFolder("/Default", containerRef);
And then call the assignLocation:
FolderHelper.assignLocation((FolderEntry) changeActivity, folder);