Easy way of grabbing a user's date preferences

Less than one minute read time.

In Sage CRM an individual user can set their own date preferences that control how CRM date and datetime fields are then displayed. This is done in the My CRM, Preferences tab screen.

If you are trying to establish how a date calculation should be made this could be a pain. The full range of choices that you have to handle is:

d.m.yyyy
dd.mm.yyyy
dd/mm/yyyy
m.d.yyyy
mm.dd.yyyy
mm/dd/yyyy
yyyy.mm.dd
yyyy/mm/dd

This range of choices is stored in custom_captions.

select capt_code from custom_captions where capt_family = 'userdateformat'

The individual users preference is then stored in the usersettings table. So Susan Mayes could be retrieved using the SQL

select uset_value from usersettings where uset_userid = 4
and uset_key = 'nset_userdateformat'

In internal script (Workflow, Tablelevel, Create Script, Validate Script) you can access the CurrentUser object.

This has the very useful property "CurrentUser.user_prf"