Hi,
I have a soft attribute (URL) for WTPartUsageLink called LabelControl.
Under the Uses tab of Structure tab of a WTPart, I want to be able to set a URL based on the label entered in the URL Label field.
The label will be the name of a WTDocument in Windchill and the URL is the details page of the WTDocument.
I have tried to give the label and the URL using the following code, but the value of the attribute is not reflecting:
WTPartUsageLink usageLink = WTPartUsageLink.newWTPartUsageLink(part, part.getMaster());
part = (WTPart) WorkInProgressHelper.service.checkout(part, WorkInProgressHelper.service.getCheckoutFolder(), "").getWorkingCopy();
PersistableAdapter obj = new PersistableAdapter(usageLink, null, Locale.US, new UpdateOperationIdentifier());
obj.load("LabelControl");
String url = getDetailsURL(doc); //gets the url of the WTDocument
Hyperlink link = new Hyperlink(url, label);
obj.set("LabelControl", link);
obj.apply();
PersistenceHelper.manager.modify(usageLink);
WorkInProgressHelper.service.checkin(part,"success part");
How do I do this?
Thanks in advance.