I've hit a wall with this. I've been trying to get the wrapper service that I wrote to work for a non-Administrative user for 16 hours now. It's always been the same problem. Something about the AddStreamEntry() service inside of my wrapper is causing problems. I've come to the conclusion that there is some hidden permission that I need to put in place for regular users, because Administrative users have no problem with getting the wrapper to work. Here's the wrapper service in question:
Inputs: string command; string pointer;
// result: INFOTABLE
let values = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape({
infoTableName: undefined /* STRING */,
dataShapeName: 'MasterChildStreamDS' /* DATASHAPENAME */
});
values.Command = command;
values.PointerData = pointer;
me.AddStreamEntry({ //This is the line the ScriptLog points at for the error
sourceType: undefined /* STRING */,
values: values /* INFOTABLE */,
location: undefined /* LOCATION */,
source: undefined /* STRING */,
tags: undefined /* TAGS */,
timestamp: undefined /* DATETIME */
});
// result: INFOTABLE dataShape: ""
let streamEntries = me.GetStreamEntries({
oldestFirst: false /* BOOLEAN */,
maxItems: undefined /* NUMBER */
});
me.timestamp = streamEntries.rows[0].timestamp;
Here's the permissions I've set:
Visibility: 'MasterChildStreamDS'; 'InfoTableFunctions';
PropertyRead: timestamp;
PropertyWrite: timestamp;
ServiceExecute: CreateInfoTableFromDataShape(); AddStreamEntry(); GetStreamEntries();
Is there something I'm missing? 'Cause I can't find it. Thanks in advance or any help.
Solved! Go to Solution.
Hi Ike@ACE
Please refer to this article - Article - CS276163 - UpdateStreamEntry and AddStreamEntry services fail with error Access was attempted on a null reference variable in ThingWorx (ptc.com)
Provide permission to the resource/entity mentioned in the article and try again
/VR
Hi Ike@ACE
Please refer to this article - Article - CS276163 - UpdateStreamEntry and AddStreamEntry services fail with error Access was attempted on a null reference variable in ThingWorx (ptc.com)
Provide permission to the resource/entity mentioned in the article and try again
/VR