I just imported contacts to Sugar. The contacts are the employees at our company, and I want to create user accounts for them without doing them one by one. How would I go about doing this?
Any help would be appreciated
Thanks
I just imported contacts to Sugar. The contacts are the employees at our company, and I want to create user accounts for them without doing them one by one. How would I go about doing this?
Any help would be appreciated
Thanks
Hi mhuntsinger.
There are no feature to do that.
You need to create a script which create a user for each contact.
You also will need to define the password and user_name for them.
You can access this script in address bar:
index.php?module=Contacts&action=CreateUsers
This script (CreateUsers.php) should be saved into modules/Contacts/ folder.
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.
Thanks for the help andopes. I'll try that.
Hi Andopes. When I try to go to index.php?module=Contacts&action=CreateUsers it tells me "there is no action by that name".
Any suggestions?
Thanks
Hi mhuntsinger.
Accordingly to my suggestion you need to create the script modules/Contacts/CreateUsers.php
After this you can access it.
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.
Hi Andopes
I was able to find basic information about .php coding. Such as "<? php" begins the .php section of the code and "?>" ends the php section of the html. But where can I find information about how I would write the kind of code that I need to make users from my contact list.
Thanks Again
Hi mhuntsinger
The script looks like that:
PHP Code:<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
if(! class_exists('Contact')) {
require_once('modules/Contacts/Contact.php');
}
$contact_bean = new Contact();
$contact_list = $contact_bean->get_list();
foreach($contact_list['list'] as $contact) {
$user = new User();
foreach($contact->field_defs as $field => $defs) {
if($contact->$field != '' && is_string($contact->$field) && isset($user->$field)) {
$user->$field = $contact->$field;
}
}
$user->user_name = substr($user->first_name, 0, 1) . $user->last_name;
$user->user_hash = md5($user->user_name);
$user->status = 'Active';
$user->save();
}
?>
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.
Thanks
I'll try that and let you know if I get it
Hi Andopes
Thanks for all of your help so far.
I have a couple more questions though.
I put the file CreateUsers.php with the code that you gave me into sugarcrm/modules/contacts
Then I was able to go to index.php?module=Contacts&action=CreateUsers in the address bar like you said.
I then imported the contacts from that screen. But the contacts were not created as users. I went to admin/user management to check the users and they weren't in there.
Any suggestions
Thanks
Actually, now that I look at the user management it looks like there were users that were created but they are blank. There is no information in any of them, like the name the user name or the department. As it is I would still need to manually put in all the information for each user. How would I fix this so that the information is in there?
Thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks