Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
I have a WTDocument substype in that I have made one soft attribute and need to get WTDocument subtype based on the soft attribute value, what have created. How to query based on that soft attribute using queryspec and queryresult through code,
Solved! Go to Solution.
IBAs are not supported via QuerySpecs: https://www.ptc.com/en/support/article/CS125877?source=search
But use this method:
https://www.ptc.com/en/support/article/CS169049
Hi @SB_10904295
What type is the soft attribute? Is it IBA Global attribute?
You need to be more specific but the solution already exists.
Here is a thread where you can find what you need
Query-spec-for-multiple-objects
PetrH
IBAs are not supported via QuerySpecs: https://www.ptc.com/en/support/article/CS125877?source=search
But use this method:
https://www.ptc.com/en/support/article/CS169049
Hi @avillanueva
I don't understand why PTC say it is not supported if the querySspec can be used for searching by the IBA
anyway
very important point for a search objects by IBA by code
it is useful to create a database index on a StringValue table for a value and value2 column because a performance increases by 1000% and more
in my several cases the time was reduced from 6 seconds to 2ms per one call
PetrH
You can determine the correct value to use via the logical attribute report page on your windchill server. Plug in your custom type, and a report is generated. Look for the external form, and plug that into the load and get functions in the Java code below.
<Windchill Server URL>/Windchill/netmarkets/jsp/lwcType/logicalAttributeReport.jsp
com.ptc.core.lwc.server.PersistableAdapter persistAdapObj = new com.ptc.core.lwc.server.PersistableAdapter((wt.fc.Persistable) doc, null,java.util.Locale.US, new com.ptc.core.meta.common.SearchOperationIdentifier());
persistAdapObj.load("IBA|PTC_DD_LANGUAGE");
String strValue = (String) persistAdapObj.get("IBA|PTC_DD_LANGUAGE").toString();
System.out.println("Attribute Value-"+strValue);
Please ignore this, I misunderstood the question, this thread is about querying based on a soft attribute, not getting it.