Hi,
had same error on one of our custom Itemtypes, which was versionable as well.
Here is copy-paste of my issue description to Aras support:
The reason for this bug are RelationshipTypes, that do not have “source_id” set, which is the case of the “Workflow” RelationshipType.
The source of the bug is the file “\Innovator\Client\Modules\metadata\itemType.ts”. There is a function “getItemType”, which causes the bug, because it does not handle “null” values (due to missing source_id).
Looking at this function in Aras version 12 SP18, one can see that there was a null check, so this bug was introduced in newer Aras versions.
Add the null check back:
[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:351ac57f-dd67-45a0-96ba-23a908c03553:type=text&text=%09if%20%28%21criteriaValue%29%20%7B%0D%0A%09%09return%20null%3B%0D%0A%09%7D%0D%0A]
Here is the full function, with the bugfix (lines 5-7).
[embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:30ab49f6-9bd3-45a8-9f5d-b32850957c12:type=typescript&text=export%20const%20getItemType%20%3D%20async%20%28%0D%0A%09criteriaValue%3A%20string%2C%0D%0A%09criteriaName%3A%20%27name%27%20%7C%20%27id%27%20%3D%20%27name%27%0D%0A%29%3A%20Promise%3CItemType%3E%20%3D%3E%20%7B%0D%0A%09if%20%28%21criteriaValue%29%20%7B%0D%0A%09%09return%20null%3B%0D%0A%09%7D%0D%0A%09let%20itemTypeId%20%3D%20criteriaValue%3B%0D%0A%09if%20%28criteriaName%20%3D%3D%3D%20%27name%27%29%20%7B%0D%0A%09%09itemTypeId%20%3D%20await%20aras.MetadataCacheJson.GetItemTypeId%28criteriaValue%29%3B%0D%0A%09%09if%20%28%21itemTypeId%29%20%7B%0D%0A%09%09%09throw%20new%20Error%28getErrorMessage%28criteriaValue%2C%20criteriaName%29%29%3B%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%09try%20%7B%0D%0A%09%09const%20result%20%3D%20await%20aras.MetadataCacheJson.GetItemType%28itemTypeId%2C%20%27id%27%29%3B%0D%0A%09%09return%20result%3B%0D%0A%09%7D%20catch%20%28error%29%20%7B%0D%0A%09%09throw%20new%20Error%28getErrorMessage%28itemTypeId%2C%20%27id%27%29%2C%20%7B%0D%0A%09%09%09cause%3A%20error%0D%0A%09%09%7D%29%3B%0D%0A%09%7D%0D%0A%7D%3B%0D%0A]