Purpose
The purpose of this document is, to show how to add the function "Change Dtype" into the "Right mouse button" menu of a document.
The function "Change Dtype" is sometimes needed in project specific use cases, if the behavior of a document is changed and the DType value of this document is changed as well. It makes no sense to ship this function in standard configuration because usually a document stays with the DType it has been created with.
Frontend Configuration changes
Menus are configured in the configuration directory: %PLM_INSTDIR%\customize\config\menu_macros.txt
If you want the function "Change DTypes" to appear in the document menu (right-click the document), execute the following steps:
In menu_macros.txt, go to
? DOC_GENERAL = fnc.doc.open.fast.view
and add the function below:
= fnc.change.dtype
Now the function appears whenever you right-click a document.
Add preference to default.txt
To define to which DTypes an existing DType may be changed to, please open the configuration file
%PLM_INSTDIR%\customize\config\default.txt
and add the preference variable
plm.document.changeDtype.possibleDtypes.for.<currentDType>=<list of new possible dtypes>
As many preference variables can be added as needed.
If, for example, you wish to allow documents of DType "PINTM" to be transformed into documents of DType "PEXT", you have to add the following preference variable:
plm.document.changeDtype.possibleDtypes.for.PINTM=PEXT
You need to restart SAP ECTR in order to apply the new settings.
Test your changes
To test your changes, choose the document you have enhanced the menu of. Right-click the document and choose "Change DType."
In case of our PINTM → PEXT example, this would look like this:

The UI "Change DType" appears.

Now you can change the DType field value of your document.