Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Good day community,
I want to get all the style definitions on my server. Then assign permissions to these dynamically using a service. I know how to assign permissions dynamically however, I am unsure about how to get all the style definitions that are on my server.
I saw the spotlights search on searchFunctions it could be helpful.
Has anyone tried something like this before?
Best Regards,
Janice
Solved! Go to Solution.
On Entity EntityServices there is a service GetEntityList which you can pass in a entity type of 'StyleDefinition' which returns all Styles
Is this what you are searching?
On Entity EntityServices there is a service GetEntityList which you can pass in a entity type of 'StyleDefinition' which returns all Styles
Is this what you are searching?
I am trying to do the same for media entities
let styles = Resources["EntityServices"].GetEntityList({
maxItems: 10000 /* NUMBER {"defaultValue":500} */,
nameMask: undefined /* STRING */,
type: "media" /* STRING */,
tags: undefined /* TAGS */
});
But I keep getting this strange error: : Invalid Entity Type [media]
I have tried: Media, media, MediaEntities, mediaEntities and still get the same error.
I am unsure of how to specify the type.
Using the developer options, I found the payload of a spotlightSearch service and turns out that the type is: MediaEntity.
Thank you.