If you want to use dynamically created folders, you need to use the "TC_HookService_MoveToNewFolder".
Open PARTadmin and filter for "MoveToNewFolder".
Enable the Additional Task and set the desired values for "TC_HookService_MoveToNewFolder_DESTINATION_FOLDER" and "TC_HookService_MoveToNewFolder_Flags".
[CreationOptions] PdmOnCheckin_04.EXECUTE=_TC_HOOK_SERVICE.moveToNewFolder TC_HookService_MoveToNewFolder_DESTINATION_FOLDER=?"Home/DaBe/"+_Format_0 ("<PREFIXLIST(/)>").value() + "/" + _FORMAT_0("<ATTR(NN)>").value() TC_HookService_MoveToNewFolder_Flags=13
TC_HookService_MoveToNewFolder_Flags is to write as <bitfield>. 13 = 1+4+8
#:HELP; The parameter <Bitfield> for moveToNewFolder: # 1: create not existing folders? # 2: use Item owner as source folder user? # (TC_HookService_MoveToNewFolder_SourceFol der_User will be ignored) # 4: use Item owner as destination folder user? # (TC_HookService_MoveToNewFolder_DestinationFolder_User will be ignored) # 8: get sorce folder(s) from Item? # (TC_HookService_MoveToNewFolder_SOURCE_FOLDER will be ignored)
-> The Item will be moved to the configured folder.
Error message shows up trying to move document using TC_HOOK_SERVICE.moveToNewFolder.[59]
Reason: This is a Workflow problem.
IfProeTeamcenter
initially stores the Item in the folder given by the config key TC_TmpFolder, which by default is the current user's Newstuff folder. That is where the Item is currently located.The key TC_TargetFolder is applied (Item is moved) in EndCheckinTransaction, which is executed after Checkin1 (PdmOnCheckin_XX). In the case, with active MoveToNewFolder HookService in PdmOnCheckin_01, you try to move the part from TC_HOOKSERVICE_MOVETONEWFOLDER_SOURCE_FOLDER=Home/QA/GOHR/CREO to TC_HOOKSERVICE_MOVETONEWFOLDER_DESTINATION_FOLDER=Home/QA/3DFindIT. This can't work, as the Item is still in the TC_TmpFolder (in this case Newstuff).
Normally MoveToNewFolder is not required as
IfProeTeamcenter
moves the files in EndCheckinTransaction.However, if you want move the parts to a Folder not belonging to the current user or there is any other valid reason to not use the integrated move, you have to enter the TC_TmpFolder value in the key TC_HOOKSERVICE_MOVETONEWFOLDER_SOURCE_FOLDER and not to set TC_TargetFolder.