cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Is there a way to create a new table view and default that view for all users?

jreding
1-Visitor

Is there a way to create a new table view and default that view for all users?

In WC 9 we were able to create a view as WCADMIN and setting it as default would set it for all users.  This does not appear to work for 10.2 M030.  Ideally we would like to use the load file functionality to load and set the default.  The example I am looking at is setting the table view on the affected items table on a Change Task.

1 REPLY 1
BenPerry
15-Moonstone
(To:jreding)

Jen,

I created a tech support ticket for this, and it wasn't possible.  But I'd be interested to hear if anyone else thinks of a clever way to do this.

But, being the database whiz I am, I got around it using unsupported method of adding rows to the database.  Our use-case was that we were migrating from 9.1 to 10.2, and I wanted the users to "see data" a certain way.  So I created table views for 5 or 6 key tables in Windchill.  And then I set that table view as their table view.  When a user chooses a non-default table view, a row is added to ACTIVEVIEWLINK table in the database.  The table definitions themselves are stored in the TABLEVIEWDESCRIPTOR table.

With the above information, I was able to add rows to the ACTIVEVIEWLINK table.  I needed the IDA2A2 value of the table from TABLEVIEWDESCRIPTOR and the IDA2A2 value of the user from the WTUSER table.  And each new row in the ACTIVEVIEWLINK table needs its own IDA2A2 value.  That was the tricky part.  It is difficult to come up with IDA2A2 values.  But fortunately the suggestion was made to create links (aka bookmarks) in Windchill.  Then query the BOOKMARK table for these IDA2A2 values.  Then delete the links that were just created (which delete the rows and IDA2A2 values back out of the database).  Then you have a bunch of IDA2A2 values that aren't used anywhere.  So you can use them to populate the new rows of your ACTIVEVIEWLINK table.

Apply to your own use-case.  Verify on test system first.  I'm not responsible for your system.  This is Oracle database:

DROP TABLE ACTIVEVIEWLINK_BAK;

CREATE TABLE ACTIVEVIEWLINK_BAK AS (SELECT * FROM ACTIVEVIEWLINK);

INSERT INTO ACTIVEVIEWLINK (CLASSNAMEKEYROLEAOBJECTREF,IDA3A5,CLASSNAMEKEYROLEBOBJECTREF,IDA3B5,TABLEID,CREATESTAMPA2,MARKFORDELETEA2,MODIFYSTAMPA2,CLASSNAMEA2A2,IDA2A2,UPDATECOUNTA2,UPDATESTAMPA2) SELECT 'com.ptc.core.htmlcomp.tableview.TableViewDescriptor',<ida2a2 of the table, such as 477659535>,'wt.org.WTUser',<ida2a2 of the user, such as 376025063>,'PSBTree',SYSDATE,0,SYSDATE,'com.ptc.core.htmlcomp.tableview.ActiveViewLink',<one of your ida2a2 values that was obtained from temporary population of BOOKMARK table, such as 473089625>,1,SYSDATE FROM DUAL WHERE NOT EXISTS (SELECT * FROM ACTIVEVIEWLINK WHERE IDA3A5=477659535 AND IDA3B5=376025063);

INSERT INTO ACTIVEVIEWLINK (CLASSNAMEKEYROLEAOBJECTREF,IDA3A5,CLASSNAMEKEYROLEBOBJECTREF,IDA3B5,TABLEID,CREATESTAMPA2,MARKFORDELETEA2,MODIFYSTAMPA2,CLASSNAMEA2A2,IDA2A2,UPDATECOUNTA2,UPDATESTAMPA2) SELECT 'com.ptc.core.htmlcomp.tableview.TableViewDescriptor',<ida2a2 of the table, such as 477659535>,'wt.org.WTUser',<ida2a2 of the user, such as 376025063>,'PSBTree',SYSDATE,0,SYSDATE,'com.ptc.core.htmlcomp.tableview.ActiveViewLink',<one of your ida2a2 values that was obtained from temporary population of BOOKMARK table, such as 473089625>,SYSDATE FROM DUAL WHERE NOT EXISTS (SELECT * FROM ACTIVEVIEWLINK WHERE IDA3A5=477659535 AND IDA3B5=376024664);

INSERT INTO ACTIVEVIEWLINK (CLASSNAMEKEYROLEAOBJECTREF,IDA3A5,CLASSNAMEKEYROLEBOBJECTREF,IDA3B5,TABLEID,CREATESTAMPA2,MARKFORDELETEA2,MODIFYSTAMPA2,CLASSNAMEA2A2,IDA2A2,UPDATECOUNTA2,UPDATESTAMPA2) SELECT 'com.ptc.core.htmlcomp.tableview.TableViewDescriptor',<ida2a2 of the table, such as 477659535>,'wt.org.WTUser',<ida2a2 of the user, such as 376025063>,'PSBTree',SYSDATE,0,SYSDATE,'com.ptc.core.htmlcomp.tableview.ActiveViewLink',<one of your ida2a2 values that was obtained from temporary population of BOOKMARK table, such as 473089625>,SYSDATE FROM DUAL WHERE NOT EXISTS (SELECT * FROM ACTIVEVIEWLINK WHERE IDA3A5=477659535 AND IDA3B5=181017372);

INSERT INTO ACTIVEVIEWLINK (CLASSNAMEKEYROLEAOBJECTREF,IDA3A5,CLASSNAMEKEYROLEBOBJECTREF,IDA3B5,TABLEID,CREATESTAMPA2,MARKFORDELETEA2,MODIFYSTAMPA2,CLASSNAMEA2A2,IDA2A2,UPDATECOUNTA2,UPDATESTAMPA2) SELECT 'com.ptc.core.htmlcomp.tableview.TableViewDescriptor',<ida2a2 of the table, such as 477659535>,'wt.org.WTUser',<ida2a2 of the user, such as 376025063>,'PSBTree',SYSDATE,0,SYSDATE,'com.ptc.core.htmlcomp.tableview.ActiveViewLink',<one of your ida2a2 values that was obtained from temporary population of BOOKMARK table, such as 473089625>,SYSDATE FROM DUAL WHERE NOT EXISTS (SELECT * FROM ACTIVEVIEWLINK WHERE IDA3A5=477659535 AND IDA3B5=451019531);

COMMIT;

Other disclaimers:

  • The example above is for setting the view for PSBTree for 4 users.  For the Affected Objects of a Change Task, the internal name would be something else, different than PSBTree.
  • I did this almost 2 years ago.  I don't recall the details, but it looks like this code will only update the the users table view if they haven't already set one.  If they already click onto another table, it won't overwrite that.
  • Review the code carefully so you know what you're doing.
  • Let me know if you have any questions.
  • This is something that seems simple to implement with a Product Idea.  It is not that hard to set the active view for many users.  Just need to define the requirements and prerequisites around it (all users in org?  overwrite if they already have a different table view selected?  etc?).
  • I look forward to feedback from the community on this one.
Announcements


Top Tags