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.
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.
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.
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/
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
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.
I must try this tool. Thanks David.
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).
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.
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?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks