2

I want to get the schema's where used list of page templates, schemas etc.,provided with schema ID? Please help on this?

8

CoreService:

 var list = ClientAdmin.GetList("tcm:1-1-8", new UsingItemsFilterData());
 var listXml = ClientAdmin.GetListXml("tcm:1-1-8", new UsingItemsFilterData());

Tom.NET:

schema.GetListUsingItems();
| improve this answer | |
  • Could you please tell me how to get that 'Where used' list's publication names? – Bhavya Mar 9 '16 at 11:29
  • I have updated my answer – Stanislav Maryenko Mar 9 '16 at 11:55
  • It is throwing an error for me like "LocationInfo" cannot be resolved or is not a field. Its the same with "item" – Bhavya Mar 9 '16 at 12:13
  • That is probably because your list is empty. Can you first check this? – Stanislav Maryenko Mar 9 '16 at 14:18
  • No my list is not empty. I am able to read all the where used values. – Bhavya Mar 10 '16 at 4:48
3

For this scenario, you can try the following using core service as there is no built in methods for this:

    UsingItemsFilterData filterCriteria = new UsingItemsFilterData();
    filterCriteria.BaseColumns = ListBaseColumns.Id;
    filterCriteria.IncludeLocalCopies = true;
    var resultList =CoreServiceClient.GetList("SchemaURI", filterCriteria);

If you don't want to use or have core service the same can be achieved using TOM.Net API, there is a method on IdentifiableObject called HasUsingItems() which will give you the details also. Check this link once !!

You can have a look in this link which will give you ideas on how to use core service more effectively for similar kind of scenarios.

Let me know if this helps !!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.