Skip to main content
1-Visitor
May 11, 2015
Question

How to get the custom softtypes in the query spec

  • May 11, 2015
  • 4 replies
  • 4637 views

Hello,

I would like to display all the objects belongs to a subtype of the WTDocument using the query spec. can you please help me int his. The below code did not help me in this.

Thanks.

QuerySpec qs = new QuerySpec(WCTYPE|wt.doc.WTDocument.class|<MYCUSTOM_TYPE>);

4 replies

1-Visitor
May 21, 2015

You can do this using the key reference id

first get the reference using:-

TypeDefinitionReference typeDefRef = TypedUtility.getTypeDefinitionReference("<customtype>"));

then put it in qs:-

qs=new QuerySpec( new SearchCondition(WTDocument.class,"typeDefinitionReference.key.id", SearchCondition.EQUAL, typeDefRef.getKey().getId()));

JohnDavid1-VisitorAuthor
1-Visitor
May 21, 2015

Hi Hrishikesh,

Many thanks for your reply.

I am very new to Windchill customization. custom type is nothing but the internal name ??

I will test it and let you know the result