Results 1 to 4 of 4

Thread: How do I get a user's timezone info?

  1. #1
    john2x is offline Sugar Community Member
    Join Date
    May 2013
    Posts
    16

    Default How do I get a user's timezone info?

    Using SugarCRM's REST API, I can't seem to find where to get a user's timezone info.

    Tried `get_entry`, but it only listed:

    [u'employee_status', u'last_name', u'picture', u'created_by_name', u'show_on_employee
    s', u'team_id', u'accept_status_name', u'phone_fax', u'full_name', u'address_state',
    u'team_name', u'messenger_id', u'address_country', 'id', u'email1', u'first_name', u'
    date_entered', u'title', u'address_street', u'receive_notifications', u'reports_to_id
    ', u'phone_work', u'created_by', u'name', u'reports_to_name', u'UserType', u'external
    _auth_only', u'authenticate_id', u'modified_by_name', u'department', u'sugar_login',
    u'user_name', u'email', u'user_hash', u'status', u'm_accept_status_fields', u'pwd_las
    t_changed', u'description', u'deleted', u'is_group', u'phone_other', u'is_admin', u'c
    _accept_status_fields', u'messenger_type', u'accept_status_id', u'address_city', u'mo
    dified_user_id', u'team_set_id', u'preferred_language', u'date_modified', u'phone_hom
    e', u'address_postalcode', u'phone_mobile', u'system_generated_password', u'email_lin
    k_type', u'default_team', u'portal_only']

  2. #2
    Angel's Avatar
    Angel is offline Sugar Community Member
    Join Date
    Jul 2005
    Location
    Los Angeles
    Posts
    5,205

    Default Re: How do I get a user's timezone info?

    Try executing get_entry() against the UserPreferences module and retrieve the 'contents' field where the category field = 'global' and assigned_user_id = 'id_of_user_whose_timezone_you_want'

    The value in the 'contents' field is a base64 encoded JSON array which contains the value you are looking for.
    Regards,

    Angel Magaņa
    Technical Solutions Architect
    Co-Author: Implementing SugarCRM 5.x (Packt Publishing -- Sept. 2010)
    Blog: http://cheleguanaco.blogspot.com.
    Twitter: @cheleguanaco.

  3. #3
    john2x is offline Sugar Community Member
    Join Date
    May 2013
    Posts
    16

    Default Re: How do I get a user's timezone info?

    Hi Angel,

    I tried querying the UserPreferences module, but I got a 500 error (with v6.5). Is it available for v6.X?

    Thanks.

  4. #4
    john2x is offline Sugar Community Member
    Join Date
    May 2013
    Posts
    16

    Default Re: How do I get a user's timezone info?

    Here's the request I'm sending:

    https://collabspot.sugarondemand.com...php?rest_data=["foobar", "UserPreferences", "userpreferences.assigned_user_id = \"1\"", "", 0, [], 5, 0]&input_type=json&method=get_entry_list&response_ty pe=json

    it returns 500 status "Database failure. Please refer to sugarcrm.log for details."

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Convert GMT to User's timezone. How is sugar doing it?
    By work77 in forum Developer Help
    Replies: 2
    Last Post: 2011-06-03, 09:55 PM
  2. Replies: 2
    Last Post: 2009-02-13, 10:08 AM
  3. iReports and timezone info
    By williamh in forum Developer Help
    Replies: 1
    Last Post: 2008-04-07, 10:42 AM
  4. Can't save user timezone - always ask for timezone after logon
    By buzznissa in forum General Discussion
    Replies: 0
    Last Post: 2006-09-15, 12:20 PM
  5. Default time for new activities using users timezone info
    By ts4053 in forum Feature Requests
    Replies: 1
    Last Post: 2006-01-10, 06:20 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •