Skip to main content
added 8 characters in body
Source Link
Atila Sos
  • 6.3k
  • 2
  • 16
  • 26

How to validate using TOM.NET if a componentComponent is present in a specific parent publicationPublication

I'm using SDL Web 8.5 While rendering a component presentationComponent Presentation from child publicationPublication, I need to validate the presence of the componentComponent in it's top parent publicationParent Publication. It might happen that it's been created in level 2 parent publicationPublication and localized in child or locally created in child publicationPublication.

I do not receive a NULL object while creating a componentComponent object with parent publication which does not exist but receive exception while accessing it's properties at runtime. var ParentObject = this.Engine.GetObject(new TcmUri(repositoryChildObject.Id.ItemId, repositoryChildObject.Id.ItemType, this.ParentPublication.Id.ItemId));

var ParentObject = this.Engine.GetObject<Component>(new TcmUri(repositoryChildObject.Id.ItemId,
repositoryChildObject.Id.ItemType, this.ParentPublication.Id.ItemId));

The globalObject is not NULL although such a componentComponent does not exist in parent publicationPublication. globalObject.TitleglobalObject.Title throws an error "Component does not exist."

Component does not exist

How to validate using TOM.NET if a component is present in a specific parent publication

I'm using SDL Web 8.5 While rendering a component presentation from child publication, I need to validate the presence of the component in it's top parent publication. It might happen that it's been created in level 2 parent publication and localized in child or locally created in child publication.

I do not receive a NULL object while creating a component object with parent publication which does not exist but receive exception while accessing it's properties at runtime. var ParentObject = this.Engine.GetObject(new TcmUri(repositoryChildObject.Id.ItemId, repositoryChildObject.Id.ItemType, this.ParentPublication.Id.ItemId));

The globalObject is not NULL although such a component does not exist in parent publication. globalObject.Title throws an error "Component does not exist."

How to validate using TOM.NET if a Component is present in a specific parent Publication

I'm using SDL Web 8.5 While rendering a Component Presentation from child Publication, I need to validate the presence of the Component in it's top Parent Publication. It might happen that it's been created in level 2 parent Publication and localized in child or locally created in child Publication.

I do not receive a NULL object while creating a Component object with parent publication which does not exist but receive exception while accessing it's properties at runtime.

var ParentObject = this.Engine.GetObject<Component>(new TcmUri(repositoryChildObject.Id.ItemId,
repositoryChildObject.Id.ItemType, this.ParentPublication.Id.ItemId));

The globalObject is not NULL although such a Component does not exist in parent Publication. globalObject.Title throws an error

Component does not exist

Source Link

How to validate using TOM.NET if a component is present in a specific parent publication

I'm using SDL Web 8.5 While rendering a component presentation from child publication, I need to validate the presence of the component in it's top parent publication. It might happen that it's been created in level 2 parent publication and localized in child or locally created in child publication.

I do not receive a NULL object while creating a component object with parent publication which does not exist but receive exception while accessing it's properties at runtime. var ParentObject = this.Engine.GetObject(new TcmUri(repositoryChildObject.Id.ItemId, repositoryChildObject.Id.ItemType, this.ParentPublication.Id.ItemId));

The globalObject is not NULL although such a component does not exist in parent publication. globalObject.Title throws an error "Component does not exist."