cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

We are working to address an issue with subscription email notifications. In the meantime, be sure to check your favorite boards for new topics.

Hidden AddStreamEntry() Permission?

Ike@ACE
13-Aquamarine

Hidden AddStreamEntry() Permission?

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

2 REPLIES 2
nmutter
14-Alexandrite
(To:Ike@ACE)

  • What is the error you receive?
  • You also need visibility for the asset and valuestream of the asset

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

Top Tags