Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Automatically modify Leads

  1. #1
    robtarr is offline Member
    Join Date
    Mar 2009
    Location
    Dayton, OH
    Posts
    18

    Default Automatically modify Leads

    Can someone please tell me how I can automatically assign a lead to a specific user based on a defined set of rules. Specifically, I want to assign them based on zip code to a user with a regional role assigned to that zip code.

  2. #2
    crmsiva's Avatar
    crmsiva is offline A Sugar Hero
    Join Date
    Jan 2009
    Location
    Chennai, India
    Posts
    1,130

    Default Re: Automatically modify Leads

    You can use a after_save logic hook to do this job

  3. #3
    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: Automatically modify Leads

    Quote Originally Posted by crmsiva View Post
    You can use a after_save logic hook to do this job
    Ideally a before_save logic_hook once you are trying to assign the user when saving.
    You can create an array containing the zip codes and specify for each zip who is the assigned user.
    Then you can let the logic_hook decide who should be the assigned user for the current Lead.

    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.

  4. #4
    robtarr is offline Member
    Join Date
    Mar 2009
    Location
    Dayton, OH
    Posts
    18

    Default Re: Automatically modify Leads

    If I'm going to add the logic hooks to the leads module, do I need to create a another folder in the custom modules folder, or can I put my code in custom/modules/leads/

  5. #5
    ronaldo is offline Senior Member
    Join Date
    Feb 2009
    Location
    Brasil
    Posts
    85

    Smile Re: Automatically modify Leads

    Yes, you can put your code in the same folder.
    Ronaldo Rodrigues
    Lampada Global Services
    Phone: 55 11 3237-3110
    Email: rodrigues@lampadaglobal.com
    Conheça nosso site: www.lampadaglobal.com

  6. #6
    dtokeefe's Avatar
    dtokeefe is offline Sugar Community Member
    Join Date
    Mar 2005
    Location
    Sao Paulo, Brasil
    Posts
    671

    Default Re: Automatically modify Leads

    You can use http://www.sugarforge.org/projects/editlogichooks/ to really simplify creating the logic hook.
    David O'Keefe
    Lampada Global Services
    SugarCRM Gold Partner
    USA: +1 908 998-2278
    BR: +55 11 3237-3110
    Skype: dtokeefe
    Email: equipe@lampadaglobal.com
    www.lampadaglobal.com

    Lampada Global delivers enterprise software and offshore programming services to customers around the world.

  7. #7
    crmsiva's Avatar
    crmsiva is offline A Sugar Hero
    Join Date
    Jan 2009
    Location
    Chennai, India
    Posts
    1,130

    Default Re: Automatically modify Leads

    I must try this tool. Thanks David.

  8. #8
    robtarr is offline Member
    Join Date
    Mar 2009
    Location
    Dayton, OH
    Posts
    18

    Default Re: Automatically modify Leads

    I installed that module - it's awesome! That's makes this a lot easier, especially for someone just getting in to Sugar.

    My question is, now that I have the logic hook firing, if I try to set a text field like, 'title', with a value from my code it works fine; but when I try to set the assigned_user it fails. When I save it, the body of the screen just goes blank and doesn't save the value. So, how do I set the assigned_user?

    Thanks for all of your help. I really appreciate it (and so will my boss).

  9. #9
    dtokeefe's Avatar
    dtokeefe is offline Sugar Community Member
    Join Date
    Mar 2005
    Location
    Sao Paulo, Brasil
    Posts
    671

    Default Re: Automatically modify Leads

    Rob,

    Take a look at: http://www.redinkdesign.net/node/6

    Keep in mind the naming conventions. Your object is $bean. Note the correct field names.

    $bean->assigned_user_id

    You can get the names from the database table or the module's vardefs. You can also echo '<pre>'; print_r($bean); die;

    Cheers.

    David
    David O'Keefe
    Lampada Global Services
    SugarCRM Gold Partner
    USA: +1 908 998-2278
    BR: +55 11 3237-3110
    Skype: dtokeefe
    Email: equipe@lampadaglobal.com
    www.lampadaglobal.com

    Lampada Global delivers enterprise software and offshore programming services to customers around the world.

  10. #10
    robtarr is offline Member
    Join Date
    Mar 2009
    Location
    Dayton, OH
    Posts
    18

    Default Re: Automatically modify Leads

    I got the logic all working, and I created a module to maintain my list of area codes.

    How can I access the fields in my new module - "Regions", from this logic hook?

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Modify Leads Module
    By aswath28 in forum Developer Help
    Replies: 2
    Last Post: 2008-10-17, 12:07 PM
  2. Replies: 0
    Last Post: 2007-08-09, 07:58 PM
  3. Automatically add leads to target lists?
    By Dale Thomas in forum Help
    Replies: 3
    Last Post: 2007-07-18, 05:05 PM
  4. Automatically add leads to email campaigns
    By dakman1 in forum General Discussion
    Replies: 1
    Last Post: 2006-10-11, 04:11 PM
  5. after creating new leads it automatically gets deleted.
    By manu in forum General Discussion
    Replies: 0
    Last Post: 2006-07-05, 06:32 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
  •