Skip to main content
4-Participant
Aug 31, 2021 4:17 AM UTC
Solved

DeleteStreamEntry service not work in Thingworx 9.0.4

Hi team,

 

I tried to delete entry using built-in service DeleteStreamEntry given the entry id, but it looks like this service did not delete successfully, the entry is still there. Is this an issue or any workaround to resolve this problem?

 

a.PNG

 

Thanks.

ShirishMorkhade
16-Pearl
Aug 31, 2021 9:59 AM UTC

Hello @LL_9777686 ,

You may want to try snippet like below.

for (var x = 0; x < tableLength; x++) {
	var row = streamEntriesForUser.rows[x];
	logger.info("streamEntriesForUser Rows :: " + row.id);
	Things["<Name_of_Your_Stream_Entity>"].DeleteStreamEntry({
		streamEntryId: row.id /* STRING */
	});
}

We wrote this snippet in TWX 8.5.3 and recently upgraded to TWX 9.2.1 and it works absolutely fine in both the environment. 

 

I am sure it will work for you with little modifications.

 

Regards,

Shirish

2 replies

ShirishMorkhade
16-Pearl
Aug 31, 2021 9:59 AM UTC

Hello @LL_9777686 ,

You may want to try snippet like below.

for (var x = 0; x < tableLength; x++) {
	var row = streamEntriesForUser.rows[x];
	logger.info("streamEntriesForUser Rows :: " + row.id);
	Things["<Name_of_Your_Stream_Entity>"].DeleteStreamEntry({
		streamEntryId: row.id /* STRING */
	});
}

We wrote this snippet in TWX 8.5.3 and recently upgraded to TWX 9.2.1 and it works absolutely fine in both the environment. 

 

I am sure it will work for you with little modifications.

 

Regards,

Shirish

Translate
Support
Sep 10, 2021 5:33 PM UTC

Hi @LL_9777686

 

If you found that the previous response was helpful, please mark it as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon

Translate