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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Getting all style definitions on my server

Janicen
16-Pearl

Getting all style definitions on my server

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

ACCEPTED SOLUTION

Accepted Solutions

On Entity EntityServices there is a service GetEntityList which you can pass in a entity type of 'StyleDefinition' which returns all Styles

nmutter_1-1726046895608.png

Is this what you are searching?

 

View solution in original post

4 REPLIES 4

On Entity EntityServices there is a service GetEntityList which you can pass in a entity type of 'StyleDefinition' which returns all Styles

nmutter_1-1726046895608.png

Is this what you are searching?

 

yes, this is what I was looking for.

Thank you @nmutter.

 

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.

Announcements


Top Tags