Results 1 to 7 of 7

Thread: Find a way to Automatically assign a lead to the admin/user as soon as it arrives

  1. #1
    stummala is offline Junior Member
    Join Date
    May 2008
    Posts
    4

    Question Find a way to Automatically assign a lead to the admin/user as soon as it arrives

    Currently, when we receive a new lead from our website, it enters Sugar into the leads module but it isn’t getting assigned to any specific User. Yes, it is part of the Global team lead pool, but not assigned to any User WITHIN the Global team. When you edit the new lead and assign it to a User…like the admin, only THEN does it show up in the “My Leads” table; because that lead is now assigned to a user.



    SO…we need to find a way to Automatically assign a lead to the admin/user as soon as it arrives.


    Any help would be greatly appreciated! Thanks.

  2. #2
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: Find a way to Automatically assign a lead to the admin/user as soon as it arrives

    You should be able to pass assigned_user_id from your form. Just set that value to the person you want to assign it to (like the admin user id which is normally 1).

  3. #3
    ivolator's Avatar
    ivolator is offline Sugar Community Member
    Join Date
    Sep 2006
    Location
    Dagobah
    Posts
    98

    Default Re: Find a way to Automatically assign a lead to the admin/user as soon as it arrives

    You'll need to write a logic_hook.
    In your logic hook check if the
    lead is new/old and based on this assign it to the preferred user.
    I am sure you can find bunch of examples on the forums how to write a logic hooks.
    The easier way would be to use work flows (not sure what is your version of sugar).
    This is more stuff for people that are managing the system rather than doing development on it....

    I hope this helps.
    May the source be with you!

    A message from the Dark Side there is ...
    Be done in sugarcrm, no core changes should. Hmmmmmm.
    ...


    Teams For The Masses
    Video Demo of CETeams module

    SimpleCaptcha - A Captcha for SugarCRM 5.2.0x


    Password Resetting For SugarCRM CE PRO and ENT 5.2.0x

  4. #4
    stummala is offline Junior Member
    Join Date
    May 2008
    Posts
    4

    Default Re: Find a way to Automatically assign a lead to the admin/user as soon as it arrives

    Thanks for the replies! Please elaborate about passing the assigned_user_id from the form? How do I manipulate this info? Is it a backend PHP mod or something from within the Sugar panel?

    We are using SugarCRM Enterprise Edition 5.1 with an Oracle datalink

    - Satish

  5. #5
    ivolator's Avatar
    ivolator is offline Sugar Community Member
    Join Date
    Sep 2006
    Location
    Dagobah
    Posts
    98

    Default Re: Find a way to Automatically assign a lead to the admin/user as soon as it arrives

    Yes you have to write code to access the assigned_user_id . It is a property of an object.
    In the Enterprise version you should have workflows. Use them if possible.
    Otherwise it is pretty easy to write code for the hooks.
    I am sure if your company has Enterprise Edition they probably have on-site developers to do this job.
    May the source be with you!

    A message from the Dark Side there is ...
    Be done in sugarcrm, no core changes should. Hmmmmmm.
    ...


    Teams For The Masses
    Video Demo of CETeams module

    SimpleCaptcha - A Captcha for SugarCRM 5.2.0x


    Password Resetting For SugarCRM CE PRO and ENT 5.2.0x

  6. #6
    stummala is offline Junior Member
    Join Date
    May 2008
    Posts
    4

    Default Re: Find a way to Automatically assign a lead to the admin/user as soon as it arrives

    Ok. Now where is this line of code located? I'm assuming in the "Leads" folder? There is a file named, "Capture.php" Is this the only place where I have to insert/modify the code for automatic assignment?

    Please advise.

  7. #7
    ivolator's Avatar
    ivolator is offline Sugar Community Member
    Join Date
    Sep 2006
    Location
    Dagobah
    Posts
    98

    Default Re: Find a way to Automatically assign a lead to the admin/user as soon as it arrives

    Please read this wiki entry
    http://www.sugarcrm.com/wiki/index.p...le=Logic_Hooks
    to get an idea what a logic hook is.
    The try building the logic hook for 'after_save' or 'before_save' event.
    The trick you need to do in your logic hook is to figure out if this is a new or old lead that is being saved.
    To figure this out you do
    PHP Code:
    //may be there are other ways of knowing this ... that's just me
    $is_this_my_new_object = new YourBean();
    if(
    $is_this_my_new_object ->retreive($bean->id)){
        
    //THIS IS NOT A NEWLY CREATED OBJECT
        //It is existing one that is being updated
         
    return ;
    }else{
      
    // so do your stuff here for the new one like set the properties of it as you wish
      
    $bean->PROPERTY 'STUFF'
      
    return ;

    You can edit directly core files, but this is a hack rather than a solution.
    Depends on your coding ethics ...
    Usually outsourcing teams do not care and hack away as much as possible.
    Pick your side

    If you really want to know how it works I urge you to look into this very simple file include/utils/LogicHook.php.
    This will open your eyes (regarding logic hooks that is)
    Good luck!
    May the source be with you!

    A message from the Dark Side there is ...
    Be done in sugarcrm, no core changes should. Hmmmmmm.
    ...


    Teams For The Masses
    Video Demo of CETeams module

    SimpleCaptcha - A Captcha for SugarCRM 5.2.0x


    Password Resetting For SugarCRM CE PRO and ENT 5.2.0x

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Automatically Add Lead/Contact
    By abundantliving in forum Help
    Replies: 1
    Last Post: 2008-07-14, 04:36 PM
  2. Assign to team instead of assign to user
    By sidh211 in forum Developer Help
    Replies: 4
    Last Post: 2008-05-16, 12:04 PM
  3. Assign items/events to an admin
    By trivoc in forum Help
    Replies: 1
    Last Post: 2008-03-11, 11:11 PM
  4. Replies: 4
    Last Post: 2006-03-29, 01:03 AM

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
  •