Solved
To get all WTDocument of Specific type in windchill
Is there way to get all WTDocument of specific type in windchill through code.
Is there way to get all WTDocument of specific type in windchill through code.
QuerySpec qs = new QuerySpec(WTDocument.class);
TypeDefinitionReference typeRef = TypedUtilityServiceHelper.service.getTypeDefinitionReference("com.xxx.xxx");//Type
SearchCondition searchType = new SearchCondition(WTDocument.class, WTDocument.TYPE_DEFINITION_REFERENCE + "."+
TypeDefinitionReference.KEY + "." + TypeDefinitionForeignKey.BRANCH_ID, SearchCondition.EQUAL,typeRef.getKey().getBranchId());
qs.appendWhere(searchType, new int[] { 0 });
qs.appendAnd();
qs.appendWhere(new SearchCondition(WTDocument.class, WTDocument.LATEST_ITERATION, SearchCondition.IS_TRUE),new int[] { 0 });
QueryResult allDocResult = PersistenceHelper.manager.find((StatementSpec) qs);No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.