Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. 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);
