Skip to main content
1-Visitor
September 15, 2016
Question

Is there an existing programmatic way to find objects by owner?

  • September 15, 2016
  • 1 reply
  • 2711 views

In Thingworx 7.2, I would like to find all objects owned by a particular user.

I see that I can use SpotlightSearch to find all objects of a particular type and then use an InfoTable filter to filter by owner.

However, is there a more direct way to do this that woud reduce the response payload from the server to only objects owned by the specified user without post filtering?

Thanks for any feedback,

Gordon Fleming

1 reply

1-Visitor
September 16, 2016

Hi Gordon,

What's owner, a custom property made by you? there's no built in owner concept on TW.

Best Regards,

Carles.

gfleming1-VisitorAuthor
1-Visitor
September 16, 2016

Then what does EntityServices  SetOwner service do?

1-Visitor
September 16, 2016

I don't know for what purpose it's SetOwner, but clearly it's not easily recoverable this value, as there isn't any GetOwner or alike. I've tested some candidates and neither this information it's inside:

  • GetMetadata
  • GetMetadataWithPermissionsAsJSON
  • GetSummaryInformation
  • GetThingSummaryInformation

Maybe better if you need an "owner" feature, build your own creating a property called "owner" on the things.