Skip to main content
10-Marble
January 3, 2017
Question

Is there a way to programmatically set a user windchill preference?

  • January 3, 2017
  • 2 replies
  • 2027 views

No luck so far with the service (PreferenceService2) setvalue methods.  I see they are there but I must be misreading the method signatures.  I'd like to try to allow the users to set preferences through a web page (to enable other validation, etc. niceties).

2 replies

10-Marble
January 3, 2017

Ah.  So right wrong or indifferent, setting preference worked with:

   PreferenceHelper.service.setValue("<INTERNAL PREFERENCE NAME>","<CLIENT NAME>", "<UPDATED VALUE>", <CURRENT WTUser>);

But (FYI) I don't see this as a supported call according to the javadocs.....

15-Moonstone
January 4, 2017

Brian Krieger‌,

I've been using PreferenceHelper.service for a year in 10.2 M030.  It is called nearly daily.

You're right - it is not marked as supported.  But it seems to be working.  Just do careful testing whenever upgrading.

Shirishkumar Morkhade‌‌ and I put some code around this for both getValue() and setValue() back in February 2016.  My support case is C12653301.  I know you can't view that ... but Shirish could view if he wanted to refer back to it and add anything else to this message.