Results 1 to 5 of 5

Thread: Accessing current user team and id with code

  1. #1
    edanb is offline Senior Member
    Join Date
    Dec 2008
    Posts
    25

    Default Accessing current user team and id with code

    In a custom logic hook, how do I access the current users team_id and id?

    Thanks

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Accessing current user team and id with code

    Hi Edan

    Can you clarify?
    Which fields do you want to access? From which module?

    Regards
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    genius786's Avatar
    genius786 is offline Sugar Community Member
    Join Date
    Nov 2008
    Location
    Karachi, Pakistan
    Posts
    129

    Smile Re: Accessing current user team and id with code

    Hi,


    According to me you have to use $bean->[variable name] for access in logic hook



    Best regards,
    SARFARAZ AHMED KHAN
    Karachi, Pakistan
    skype: genius_crystal
    genius_crystal@hotmail.com
    92-314-2595624

  4. #4
    mvngti is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    South Africa
    Posts
    510

    Default Re: Accessing current user team and id with code

    Very simple!
    PHP Code:
    global $current_user;
    $id $current_user->id;
    $team_id $current_user->default_team
    --


    Marnus van Niekerk

    There are only 10 types of people in the world
    those who can read binary and those who don't

    Modules:
    CE Teams - Upgrade safe teams module for Community Edition
    FieldACL - Field Level Access Control for Community Edition
    EditLogicHooks - Create and edit Logic Hooks from the Admin GUI
    FlexibleChartDashlet - Display any data in a Dashlet Chart
    DocumentThumbnails - Thumbnails for Documents module

    Many questions can be answered by reading the Developers Manual

  5. #5
    edanb is offline Senior Member
    Join Date
    Dec 2008
    Posts
    25

    Default Re: Accessing current user team and id with code

    Thanks, perfect.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. information current user
    By dacco in forum Developer Help
    Replies: 1
    Last Post: 2008-07-29, 04:31 PM
  2. How to get the current user name ?
    By Heilong in forum Help
    Replies: 1
    Last Post: 2008-03-07, 09:59 AM
  3. Current user auto-add to events
    By aleksans in forum Developer Help
    Replies: 0
    Last Post: 2005-07-06, 01:01 PM

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
  •