I am trying to call MFiles.GetWebLink
from within a UIX dashboard to get a link to an M-Files object - goal is to open a new browser tab with the URL so user can work on that particular object.
But I always get a rejected Promise with
TypeError: Cannot read properties of undefined (reading 'itemType')
This is puzzling, as there is no property called itemType in any of the UIX structures / objects.
Call parameters:
MFiles.GetWebLink(
{
"obj_id": {
"type": 0,
"item_id": {
"internal_id": 71,
"external_repository_id": {
"connection": "",
"item": ""
}
}
},
"version": {
"type": 4,
"internal_version": 12,
"external_repository_version": "",
"external_repository_sort_key": 0
}
},"B1F89286-0DCE-4090-9408-101FFAF82256", undefined, undefined, true, 12 ).then(url => { /* ... */ });
I have alternatively tried to pass the GUID with curly braces and omit some of the last 4 arguments.