Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Can anyone please look at it as i want to execute this service from RESOURCES in vuforia studio but i am unable to execute it. Request is not going.
$timeout(() => {
twx.app.fn.triggerDataService("CurrentSessionInfo", "GetCurrentUserExtensionProperties");
}, 100);
$scope.$on("GetCurrentUserExtensionProperties.serviceInvokeComplete", function (evt, arg) {
let result = $scope.app.mdl["CurrentSessionInfo"].svc["GetCurrentUserExtensionProperties"].data;
console.log("Jamal Ashraf"+result);
/* var userNames = [];
for (var i = 0; i < result.array.length; i++) {
userNames.push({ "value": result.array[i].value });
console.log(result.array[i].value);
}*/
// $scope.view.wdg["select-1"].list = userNames;
});
Solved! Go to Solution.
I got the solution but thats strange because service itself does not have any parameter in thingworx but it needs parameter to run as below you can see:
var params = {"type":"Things"};
twx.app.fn.triggerDataService("CurrentSessionInfo", "GetCurrentUserExtensionProperties",params);
}, 100);
now it is working fine as expected.
$scope.$on("GetCurrentUserExtensionProperties.serviceInvokeComplete", function (evt, arg) {
let result = $scope.app.mdl["CurrentSessionInfo"].svc["GetCurrentUserExtensionProperties"].data.current.description;
$scope.app.params.userName=result;
console.log("The user"+ result +" is loggedIn!");
});
I got the solution but thats strange because service itself does not have any parameter in thingworx but it needs parameter to run as below you can see:
var params = {"type":"Things"};
twx.app.fn.triggerDataService("CurrentSessionInfo", "GetCurrentUserExtensionProperties",params);
}, 100);
now it is working fine as expected.
$scope.$on("GetCurrentUserExtensionProperties.serviceInvokeComplete", function (evt, arg) {
let result = $scope.app.mdl["CurrentSessionInfo"].svc["GetCurrentUserExtensionProperties"].data.current.description;
$scope.app.params.userName=result;
console.log("The user"+ result +" is loggedIn!");
});
sure that empty param will not work? - so at least it should be a json when ever it could be empty when not arugment required
var params = {};
- so think issue form Vuforia side not form thingworx