Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! 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
Hi avillanueva,
I have one requirement i want to query on Product id IBA which is on Product for comparison or uniqueness so can we query for all the values of that IBA which are stored in DB so i can get the stored values and i cam check if new product ID exist then do not create Product with same or throw runtime error .
I am looking for queryspec .
Thanks
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.