FORUMS

c360 Forums
 Home        Members    Calendar    Who's On

Welcome Guest ( Login | Register )
      



User preferencesExpand / Collapse
Message
Posted 10/11/2006 3:51:02 PMPost #694
 

c360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guru
In Microsoft CRM, users have a certain number of personal settings they can update. An example of a user setting is the number of records per page the user wants to see in a grid. However there is an important limitation associated with user settings: developers cannot add new ones for their own purpose.

Our SDK solves this problem by allowing you to save and read User Preferences (we call them 'preferences' to prevent any confusion with the 'settings'). The preferences are loaded and cached in memory and therefore are very fast to access. However, because they are in memory, I recommended that you use it only for a few small values and not for storing large amount of data. Just be reasonable!

There are three methods that you can use to read and save preferences:

  • GetPreference(preferenceName)
  • RemovePreference(preferenceName)
  • SetPreference(preferenceName, preferenceValue)

Here are examples:

Instance.CurrentUser.SetPreference("FavoriteColor", "Green");

string favoriteColor = Instance.CurrentUser.GetPreference("FavoriteColor");

Instance.CurrentUser.RemovePreference("FavoriteColor");

Behind the scenes, the preferences are saved in small XML files in a folder called 'UserPreferences' off of the root of your solution. I have noticed that this folder is not included in the current release of the SDK. I will make sure that this is corrected in the next release but in the mean time, you will need to create it manually.

IMPORTANT: Since each user will be updating their preference XML file, you need to make sure that you grant your users the ability to read and write in this folder.

 

« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: kanika.jackson, Ken Champion

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 5:20am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 1.109. 16 queries. Compression Enabled.