Accounts to Contacts in SUGARCRM - php

I am new to sugar and need to have each Account tied to one Contact, the same way that each Lead is linked to a Contact and Account. I have already changed the metadata file to make Account:Contact a 1:1 relationship but past that I am not sure what to do. I would like to ultimately be able to view the contact name for each account when I go to view Accounts as well as be able to import Accounts from a file with a contact field.
I am using Sugar Community Edition 5.2

Instead of using the existing contacts module, a suggestion would be to add a new field (e.g. called account_contact) to the accounts module. That way it would be easy to change the account list view to include the new field, and also include it in the account search options.
I don't think I fully understand you import requirement, but it is possible to set all account fields during the import. So the newly added field is also available in the import.
If you don't want the default Sugar contacts module, you can disable this in the adminstration.

Have you looked into sub-panels at all? Your contact information is always associated with the Account in the detail view--> contacts sub-panel. You want to keep only one contact per account? Create a relate field in the studio FROM CONTACTS to accounts. A one to one account field will appear in contacts and account will have a one to one sub-panel. you can reverse this just by creating this relate field in ACCOUNTS instead. A word of advice - don't start messing with the metadata until you fully understand the relationships built into sugar.

Related

Managing saas accounts and authentication using Codeigniter and Aauth Library (User can access many Accounts)

here it goes
Im building a small saas product and im using couple of libraries in my system.
Libraries
Aauth (for authentication)
When a user register in the app a new account will be generated to him/her using email address used and credentials provided. System will open an account and generate new authentication account (User name and Password).
NO ISSUE UP TO HERE.
summary of my problem is as follows:
assuming there are Account A and B which belong to two different customers and Account A has 3 users and Account B has 2 users.
Aauth library supports unique email address as the login.
How to allow user from Account A register in Account B with out issues.
i need answer from architecture point of view. How would you go about it ?
Solution i thought
Add new column in user table (will not work Aauth uses the email as the unique identifier and if i want to implement this it will require alot of source code modification).
Change the auth library to Ion_auth. Its simpler to modify and less features but still contains groups.
Make a new copy of the system for every new account (Its just not feasible in case of update or identifying an issue)
Create new DB for every single account (Again same as above)
Build my own auth library with simpler concepts and is as follows:
DB Schema
tbl_Accounts
id
name
tblt_users
id
email
password
account_id
tbl_groups
id
group_name
The issue with this solution is is solves the complexity of the schema but does not solve that users can register to a different accounts. Please suggest a better schema to solve my requirements.
Notes
This post gave me some things to consider in my design.
If my explanations is weak or require further editing please comment im happy to elaborate further or enhance the writing, Thank you

consolibyte | example_mysql_mirror | syncing related questions

I am using consolibyte "mysql_mirror script" for two way syncing. Till now syncing is working perfectly but there are questions related to syncing.
We want customer billing and shipping address without First Name and Last Name. Requirement is to get only customer's address that is valid and can be used in google maps API. Question is that
Is it possible through code modification or any other way to get customer's clear address.
Customer's Mobile and Website information is not synced from QBD to MySQL. Is it possible through code modification to sync this information and if yes, can you please give me direction what code modification is required to sync it.
Some tables are not synced from QBD to MySQL like "qb_unitofmeasureset". Is there any page that specifies the list of tables that wouldn't be synced?
As per my understanding if i set mode to MODE_READWRITE and use only QUICKBOOKS_OBJECT_** option for customer type, then two way sync will work correctly.
What is the purpose of other three
QUICKBOOKS_ADD_CUSTOMERTYPE',
QUICKBOOKS_QUERY_CUSTOMERTYPE'
QUICKBOOKS_IMPORT_CUSTOMERTYPE
I see these four actions for other entities as well.
Please make sure you read this first:
http://consolibyte.com/forum/viewtopic.php?id=20
And:
https://github.com/consolibyte/quickbooks-php/blob/master/docs/web_connector/example_mysql_mirror.php
We want customer billing and shipping address without First Name and Last Name.
The data synced is the data in QuickBooks. If QuickBooks has the first/last name in it, then the data that gets synced will have the first/last name in it.
Customer's Mobile and Website information is not synced from QBD to MySQL. Is it possible through code modification to sync this information
You should refer to the QuickBooks OSR for this. If it's accessible in the OSR, you should be able to add support for it.
I think you'd have to add the fields in here:
https://github.com/consolibyte/quickbooks-php/tree/master/QuickBooks/QBXML/Schema/Object
But I'm not 100% sure.
Some tables are not synced from QBD to MySQL like "qb_unitofmeasureset". Is there any page that specifies the list of tables that wouldn't be synced?
I don't have this information anywhere, no.
What is the purpose of other three QUICKBOOKS_ADD_CUSTOMERTYPE', QUICKBOOKS_QUERY_CUSTOMERTYPE' QUICKBOOKS_IMPORT_CUSTOMERTYPE
These are used in other parts of the framework. They are NOT used with the SQL mirror code.

Change Magento Customer Account Create in data to website

I am trying to find a way to update the accounts already created in admin panel.
During the create process, the account was created mistakenly in Admin section (caused user to not login via frontend).
See Screenshot: http://puu.sh/9Rjvp/6f4fffd1c6.jpg or http://i.stack.imgur.com/0Q2vm.jpg
I am looking for a programmatic approach using which I can update the account created in value to "website" after-which the customer can be able to login to site. (this can be database direct update if its best suite)
Reason behind for looking a programmatic solution is clear for following reasons.
The number of effected accounts are about 500+
Each or many of these accounts have orders belonging to their account (therefore re-create is not a good approach).
Let me know what database values I have to change for this fix or what should I need to instruct to my custom module?
Any help is highly appreciated.
Following is customer update code snippet:
$customer = Mage::getModel('customer/customer')->load(1212);
$customer->setWebsiteId(2)
$customer->save();
The above code will update website to 2 for customer 1212.
God luck!

Create Magento customer directly to Magento database

What i need is a solution to create a magento customer from an external php application (developed in the yii framework) connected directly to a magento database. The customer info will be entered using a form. The only fields from the magento customer that i am really interested in are customer email and password i.e. i want to create a customer with minimum field that only include email and password as form entry. However, i do not mind adding first name and last name to the form if they are "required" fields. I know that for Magento customer creation, webstore_id and store_id are required, but these can be hard-coded to default values thats okay.
I found code online that demonstrate how to create a customer while utilizing the Mage.php file. Some links to these tutorials include:
http://www.douglasradburn.co.uk/adding-new-customers-to-the-magento-store-programmatically/
http://inchoo.net/ecommerce/magento/programming-magento/programmaticaly-adding-new-customers-to-the-magento-store/
But in these tutorials, they have hard-coded the customer info. Like i said, my requirements include using forms on a php page from an external php application in yii framework.
Solutions will be greatly appreciated.
Create a module in your magento for retrieving the informations from your script and then implement this kind of stuff :
Create customer programmatically

Can I have a user database synced with SugarCRM and use it mostly for emailing?

I work for a company that has a website with about 700,000 users, it would need a tool that would:
List all users
Email users, create templates, send a newsletter
Show products a user has purchased
If you find a user, show which emails have been sent to the user
Create automated tasks, example: send an email to every user that has a product expiring in 30 days
I'm not sure a CRM can do all theses things, I wanted to try a CRM to figure out how close can I get to having a tool that can do all this. I read that SugarCRM is pretty good, and its free so I'm going to try it out.
What I wanted to know is, using the REST or SOAP api of SugarCRM, can I synchronise all my users with the SugarCRM database ? Or for example each time a user is created on our website, insert it in the database.
And then each time we send an email with our website, use SugarCRM instead to send a mail, and store the data. So that we can view which emails have been sent to specific users.
Thank you
Yes you can do all that but it may require some customisation to suit it exactly to your needs. By 'users' I assume you are referring to Customer 'Accounts' as known on the SugarCRM?
Add custom fields to the Contacts module using Studio. The easiest and quickest way to get your data in will be directly to the database.
The standard fields in Sugar Contacts go in the contacts table. Your custom fields will have "_c" appended to their names and be created in the contacts_cstm table. The two tables are related by contacts.id = contacts_cstm.id_c, which is generally a GUID field (but can be any string value if you need it to be).
Then you need to have a process to add new users in your website into sugar. I suggest polling your user db periodically to look for new records and using the SOAP/REST API (good luck though, it's fairly horrible) to insert them into Sugar.
Other than that your use case is pretty much standard Sugar. For automated tasks which happen whenever an email is sent/received or when a new contact is created, you'll want to look at logic hooks, search for logic_hooks.php in the Sugar documentation.

Categories