Is there a way to find out if a retrieved component is dynamic/publishable using core service ? I am not able to see any property that can tell me that .
Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. It only takes a minute to sign up.Sign up to join this community
As user978511 noted, it's not the component which determines whether publishing is dynamic, but the component template. Using the core service, you can retrieve a
ComponentTemplateData object and check its
ComponentTemplateData also has a
RelatedSchemas property, so with a bit more code you could find out whether a given component is based on a schema for which there is a dynamic template.
If there is at least one dynamic component template, you will be able to publish the component. Publishing the component will result in a component presentation being published for each of the dynamic component templates related to the schema.
If it is highly required to know if the component can be used as a DCP I can think of two ways to achieve this, though it will be pretty expensive operation.
CoreServiceClient.ResolveItemsshould resolve the component if it has any dynamic component templates.
Publication.Get(List)ComponentTemplatesand then checking if any of the templates is dynamic.