Results 1 to 8 of 8

Thread: Where is the new user saved ?

  1. #1
    dskanth is offline Senior Member
    Join Date
    Mar 2009
    Posts
    97

    Smile Where is the new user saved ?

    Hello, iam new to sugar crm, and iam pretty curious to know where is the user profile saved ?
    My actual requirement is that: i have to write a trigger to save the user details in another external table, when the user profile is edited in Sugar.
    I dont see where the user profile is saved to the database (in which file).

    Can you please tell, which file needs to be modified, and where can i write custom query ?
    Also, can i use triggers for insert / update in the user table of Sugar ?

    Please guide me. Its very urgent.

  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: Where is the new user saved ?

    The main user information are saved into users table.
    Some user preferences, like date format, time zone, are saved into user_preferences table.
    You may create a logic_hook before_save into Users module to save the uses info into another table/database.

    Cheers
    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
    dskanth is offline Senior Member
    Join Date
    Mar 2009
    Posts
    97

    Smile Re: Where is the new user saved ?

    Hi Andopes, thanks a lot for your reply !
    Can you please tell me in which file do i need to write the code (logic hook) for saving the user info in the external database table, and any code snippet of the logic hook for this?
    I would be grateful to you.
    Last edited by dskanth; 2009-05-14 at 11:12 AM. Reason: better understandability

  4. #4
    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: Where is the new user saved ?

    Have a look on editLogicHook project.

    Cheers
    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.

  5. #5
    dskanth is offline Senior Member
    Join Date
    Mar 2009
    Posts
    97

    Default Re: Where is the new user saved ?

    Hai Andopes, i have installed the EditLogichooks module, but could not see it in the Admin > Studio.
    How can i proceed, am i missing something ?
    Last edited by dskanth; 2009-05-14 at 11:53 AM. Reason: more understandability

  6. #6
    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: Where is the new user saved ?

    Use the RTFM method.

    Cheers
    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.

  7. #7
    dskanth is offline Senior Member
    Join Date
    Mar 2009
    Posts
    97

    Cool Re: Where is the new user saved ?

    Hai, i dont understand what is RTFM method.
    I have found out the Logic Hooks and now i have written this code inside my new logichook, for Users module.

    <?php
    class Users_logichook_class
    {
    function Users_logichook_method(&$bean, $event, $arguments=null)
    {
    if ($event != 'before_save') return;
    // Insert your custom logic between these comments

    $conn=mysql_connect("localhost","root","root");
    mysql_select_db("scheduler");
    $sql="insert into patients values (null,'a','a','a','a',22,'a','a','a','','',null)";
    $res=mysql_query($sql);
    $row=mysql_fetch_row($res);
    echo 'First name: '.$row[1];
    mysql_close($conn);

    // Insert your custom logic between these comments
    }
    }
    ?>

    Iam running Sugar CRM in my localhost, and now when i update a user in Sugar, i need to edit / insert the user details in a table (custom) of another database in my localhost.
    But when i edited the user and saved in the Sugar, the values are not getting inserted in the external table. Whats wrong ?
    What can i do to get this working ?
    Please suggest me the logic for logic hooks.
    Thank you.
    Last edited by dskanth; 2009-05-14 at 12:32 PM.

  8. #8
    Join Date
    Oct 2009
    Location
    Bangalore
    Posts
    69

    Default Re: Where is the new user saved ?

    Quote Originally Posted by andopes View Post
    Use the RTFM method.

    Cheers
    Hi Andopes,

    Please guide me in installing editlogichook module and writing the logic hook to connect to the external databae and displaying the the data from it in sugarcrm custom module.

    And what is RTFM method.

    Thanks in advance

    --Nagaraj S Koanguthi

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. timezone not being saved for one user
    By mikesolomon in forum Help
    Replies: 6
    Last Post: 2010-06-02, 11:27 AM
  2. How to "assign" "Saved search" for new user
    By ivit in forum Developer Help
    Replies: 2
    Last Post: 2009-02-20, 09:19 AM
  3. Replies: 0
    Last Post: 2008-11-03, 08:33 AM
  4. Replies: 6
    Last Post: 2008-07-10, 04:18 PM
  5. User preferences not saved
    By dromin in forum Help
    Replies: 1
    Last Post: 2006-04-07, 12:41 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
  •