Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
Hi All,
This is Windchill 10 question.
I have an attribute called "DesignControl" with logical name - "ext.abc.DesignControl". It has discrete set values in format like - Internal Name / Display Name as:
Design_A / Design A
Design_B / Design B
.....
For a document when I execute following code, I always get the value of the attribute to be - "Design_A" instead of "Design A" which is the display value.
WTDocument tmpDoc = //Retrieved from search results
LWCNormalizedObject obj = new LWCNormalizedObject(tmpDoc,null,Locale.US,null);
obj.load("number","name","IBA|ext.abc.DesignControl");
System.out.println("Design Control Value - " + obj.getAsString("IBA|ext.abc.DesignControl"));
What other API should I be using to get the correct display value ?
Regards,
Hi Sameer,
LWCNormalized API gives you the value which is stored and in case of discrete set values the internal name is always getting stored thats why its alwasys return you the internal name.
You can using LWC API to help this function.
com.ptc.core.meta.common.TypeIdentifier identifier = wt.type.TypedUtility.getTypeIdentifier("soft type name");
com.ptc.core.lwc.common.view.TypeDefinitionReadView view= com.ptc.core.lwc.server.TypeDefinitionServiceHelper.service.getTypeDefView(identifier);
com.ptc.core.lwc.common.view.AttributeDefinitionReadView singleibaView= view.getAttributeByName("IBA name only");
// The key is 'displayName'.
String displayName= singleibaView.getPropertyValueByName("displayName").getValue(wt.session.SessionHelper.manager.getLocale(), false).toString();
Sorry, but may you please provide an complete example (working) using that feature in an infoengine task?
I did try, but I was unable to reproduce in my environment.
In fact I was trying to get the localized content of 'theTableColumnDefinition' field of 'com.ptc.core.htmlcomp.tableview.TableViewDescriptor' class output,
May you please write an exemple when it's not IBA field like: objName, objDescription, iteration.note, etc.?