Skip to main content
12-Amethyst
October 9, 2024
Solved

Adding columns to subscriptions table

  • October 9, 2024
  • 1 reply
  • 1041 views

Version: Windchill 12.1

 

Use Case: I am trying to add new calculated attributes to the table "Subscriptions" on the Windchill homepage.


Description:

My idea was to first add these new attributes to the type "wt.notify.NotificationSubscription" and then override the subscriptions-table and add these attributes via code.

 

However, I ended up in a quite confusing situation - the elements in this table are of type "com.ptc.core.subscription.subscriptionObjects.NmCompositeSubscription" which is not available in the Type & Attribute management. But when opening elements of this table they are suddenly of type "wt.notify.NotificationSubscription".

 

The problem is, that I thus cannot add these new attributes, as only the type NotificationSubscription is available in the Type & Attribute Management but apparently this is not the underlying type the table uses.

 

Meaning, that the table does not show any values for these new attributes, but when opening such an element in the table these attributes are then displayed (with valid values) on the info page of the element

 

Has anyone encountered this issue yet or knows a solution, or am I missing something?

 

Thanks in advance and best regards!

Best answer by TG_10272716

I was able to solve the problem myself, what I did was to define a target for the column, meaning:

myColumn.setTargetObject("oid.refObject")

where myColumn is the ColumnConfig and oid.refObject references to the method chain .getOid().getRefObject() of the tables object type (NmCompositeSubscription) which deliveres the correct type (NotificationSubscription).

 

I hope this is helpful

1 reply

TG_1027271612-AmethystAuthorAnswer
12-Amethyst
October 11, 2024

I was able to solve the problem myself, what I did was to define a target for the column, meaning:

myColumn.setTargetObject("oid.refObject")

where myColumn is the ColumnConfig and oid.refObject references to the method chain .getOid().getRefObject() of the tables object type (NmCompositeSubscription) which deliveres the correct type (NotificationSubscription).

 

I hope this is helpful